Created
October 15, 2020 18:30
-
-
Save tdrayson/b29a7c4515ddb37002ad47520bec5692 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Function to check if the current Page is a parent or not. | |
* @return bool true (1) if the current Page has children else false (0) | |
*/ | |
function wpdd_is_parent_page() { | |
// Load details about this page. | |
$post = get_post(); | |
$children = get_posts(array('child_of' => $post->ID, 'post_type' => 'service')) ; | |
return is_single() && count( $children ) > 0; | |
} | |
//Add wpdd_is_parent_page as dynamic data to conditions = 1 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment