Parent Page > Child Page Menu

You have to create a new navigation walker class in your theme, in which you will override the default output to match the one required by Bootstrap. Download a drop-in nav walker class for Bootstrap here and do the following: Load the new walker class in your theme’s template.php file: require_once(‘wp_bootstrap_navwalker.php’); Create the menu in … Read more

get content from page through AJAX

Is this the correct way to do it ? This is not the correct way to do this. What you are doing, first, doesn’t make sense conceptually. When you load that page (assuming it loaded correctly) you would be loading the entire WordPress page, not just the comments. That is, you will load <html> all … Read more

wp_list_pages Hierarchical Help

After you global $post, you can use the core WordPress function get_post_ancestors() to retrieve the parent pages. Example $ancestors = get_post_ancestors($post); if($ancestors){ foreach(array_reverse($ancestors) as $post_id){ $ancestor_page = get_post($post_id); } } Then, to retrieve all child pages of the current page, you could make it easy by using a custom function. Place your custom function in … Read more

Unable to paginate a custom page query

The problem was in the same name for category slug “categories” and the same for the custom page that was holding all categories with the same name “categories”. I have solved that by changing categories slug (in permalinks settings) to singular “category” and I have left custom page as plural “categories”. If somebody know about … Read more

Print the whole page?

First of all, your page templates will normally include everything needed to make up a page, i.e. including this structure: <html> <head></head> <body></body> </html> which is not what you want over and over in your one-pager. However if you’ve built your templates using the get_template_part() function (described quite well over here) you can reuse it … Read more

wp_query issue with post_type = page

If your goal is to load the selected custom template for each page within the loop, then you’re actually pretty close to that. You’re getting the value of _wp_page_template, but then you’re not doing anything with that template, you’re just loading content-page.php for each of those pages with the line get_template_part( ‘content’, ‘page’ );. If … Read more

How to get tagged pages to show up with tagged posts?

You need to use pre_get_posts hook. Paste this code to your themes functions.php file. add_action(‘pre_get_posts’, ‘wpse_pre_get_posts’); function wpse_pre_get_posts($q) { if( $q->is_main_query() && $q->is_tag() ) { $q->set(‘post_type’, array(‘post’,’page’) ); } }