Custom post Query and WordPress Post Query Clash

Your code: $the_query = new WP_Query( array( ‘posts_per_page’ =>’2′, ‘paged’ => $paged )); Replace With this: global $wp_query; $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array_merge( $wp_query->query, array( ‘posts_per_page’ =>’2′,’paged’ => $paged ) ); query_posts( $args ); NOTE: This code is not tested so first backup your page.

Restrict Access to Logged-In Users Page Template

This could be done in a number of ways. Please refer to the codex for further info on template hierarchy, the wordpress loop and the ‘get_template_part()’ function. The page.php is for dispalying every page. You should copy and rename it to page-restricted.php. From the original page.php, remove this part – /* Template Name: Restrict Access*/. … Read more

Nested Page Template not showing in page attributes

In WP 3.4 they allowed adding template files one level deep. Since then code has changed, however in wp-includes/class-wp-theme.php, in offsetGet() (from __get()) you’ll see: case ‘Template Files’ : $files = $this->get_files( ‘php’, 1 ); Although I can’t fully unravel the maze of code for loading a theme, the above suggests the second argument, $depth, … Read more

remove_action() not working in page template – Genesis

Page templates are called too late to effect actions. You can achieve what you need another way, by targeting this in your functions, with a test for the page template, like this: function twl_content_wrap_start() { if ( !is_page_template( “page_full-width.php” ) ) return ‘<div class=”container”>’; } BTW, as a rule of thumb, actions generally don’t echo, … Read more