Tag Info

New answers tagged

0

If you want this for pages only, which would makes sense as to what you described this, just wrap the whole bunch of code in if ( is_page() ) { ... }. If you were to put this into a function, you could just bail out early. function wpdev_156446_list_parent_page_tree() { if ( ! is_page() ) { return; } // Your above code here } // ...


0

You want to query for the pages on the current site? WP_Query is your friend! first tell it what we want $args = array( 'post_type' => 'page' ); then create the query $query = new WP_Query( $args ); now check if it found any pages if ( $query->have_posts() ) { If it did, do a standard posts loop: while( $query->have_posts() ) { ...


0

If I understand, you need to create a template that list all your pages (actors) on one template. If this is the case, you need to create the actor archive template to allow you to: Add a page where you can list all your actors Left the page template intact So, the template that you need to create is archive-actors.php Then, on this template, you need ...


0

The code you are using only gets the children of a parent page. It first checks to see in which page you are. If you are in a child page it uses the parent ID to print it's children. If you're in a parent page then it just looks for it's children using the post ID. Neither case it prints the actual parent. I edited the code so that it will print the parent. ...



Top 50 recent answers are included