Mixed custom post/post navigation problem on home page
I’m trying to create a design portfolio website for myself, and wanted to use custom posts for “projects”. The problem is that home page always returns the same posts no matter what the page is.
My setup is like this:
- Static “front page” named “My Home” that uses front-page.php as template
- Static page named “Projects” and uses projects.php as template
- Static page named Blog set up as “Posts page” and uses index.php as template.
In the front-page.php I added the following code featured on the site:
$type = array('post', 'mr_project') ;
'post_type' => $type,
'post_status' => 'publish',
'paged' => $paged,
'posts_per_page' => 10,
$temp = $wp_query; // assign orginal query to temp variable for later use
$wp_query = null;
$wp_query = new WP_Query($args);
And the loop is pretty much unmodified.
Similar code works for Projects and Blog page. Those pages use loop-projects.php and loop-blog.php.
I’ve basicly went through all posts here, and tried using navigation plugins, but the effect is same.
- The topic ‘Mixed custom post/post navigation problem on home page’ is closed to new replies.