Tag Info

New answers tagged

0

I modified my code based on this posting's answer, and the page displays everything I want now. <div id="masonry-loop" class = "group"> <?php global $post; $child_pages_query_args = array( 'post_type' => 'page', 'post_parent' => $post->ID, ); $child_pages = new WP_Query( $child_pages_query_args ); if ( $child_pages->have_posts() ) ...


0

The publish_page action is listed as deprecated. You can use the 'transition_post_status' hook to check if a page was published. function publish_page_interception( $new_status, $old_status, $post ) { if ( ($new_status != $old_status) && ($post->post_status == 'publish') && ($post->post_type == 'page') ) { ...


0

With a lot of help from @Eric Holmes, I think we've found a solution. The basic idea is to add my own rewrite rules to create the permalink structure I'm after. I added this to my functions.php: function add_rewrite_rules(){ global $wp; $wp->add_query_var( 'fakepage' ); $parentpage = 'ADD THE TOP LEVEL PAGE'S POST ID HERE'; ...


0

add this code to your fnctions.php. working of the code is given below. function wpb_list_child_pages() { global $post; if ( is_page() && $post->post_parent ) $childpages = wp_list_pages( 'sort_column=menu_order&title_li=&child_of=' .$post->post_parent . '&echo=0' ); else $childpages = wp_list_pages( ...


0

When you register a new post type for the first time, you need to visit Settings -> Permalinks so WordPress can set up the permalink rules for it. You don't even need to hit save, visiting the page is enough.



Top 50 recent answers are included