/ Published in: PHP

There's no has\_children() function in WP 2.8.4, but get\_children() returns false if the post/page has no children, so it can serve the same purpose in a page template.
Outside a page template you'd have to add a global declaration for the $post variable.
Outside a page template you'd have to add a global declaration for the $post variable.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if ( get_children( $post->ID ) ) { // ... }
URL: http://codex.wordpress.org/Function%5FReference/get%5Fchildren
Comments
