Blog & Protfolio posts list problem
-
Hi all,
I have 2 categories Blog and Porftolio like this:
(1)Blog
(2)Portfolio
(3)-Websites
(4)-Layouts
(5)-Logo
Where 1, 2…5 are category ID’s, Blog & Portfolio are root categories and Website, Layouts & Logo are subcategories of Portfolio.I’ve created 2 static pages: Home for Front Page and Blog for Posts page.
On index.php file I have the following code:
<php if(is_category(‘1’) || in_category(‘1’)) {if(is_category(‘2’) || in_category(‘2’)) continue;
//stuff for post display here} else { //start showing the portfolio stuff
if(is_category(‘1’) || in_category(‘1’)) continue;
//stuff for post display here
}
?>The problem is that I’ve only manage to display the portfolio posts. The blog post page is empty. Somehow my first condition is ignored (<php if(is_category(‘1’) || in_category(‘1’)) {).
If I use on index.php file the loop:
<?php while ( have_posts() ) : the_post() ?>
<?php the_content(); ?>
<?php endwhile; ?>
The result is: portfolio posts are displayed ok, but on blog post page I get all the posts from all the categories.Something I do wrong and I don’t know what. Please help.
The topic ‘Blog & Protfolio posts list problem’ is closed to new replies.