How to filter recent post by category only in first page block ?
-
I have a problema to solve in WordPress. The “recent post” of my frontpage gets all posts, doesnt matter the type of post. It gets all.
I use category_id to create sections of new, articles, site, etc.
But I want to filter the main latest post of my frontpage only with the category id 34.
The problem is cause the index.php file uses the block to all others “sections” (parent categories). So I need to alter the index.php to work as if they are in frontpage and with no other parameters (to the main frontpage block), it should show only the category id 34 (news). But if when in other folders/url with parameters, must follow the category of the parameter as it is today.
The block I have in index.php is that:
if ( have_posts() ) :
while ( have_posts() ) :
the_post();
ct_mission_news_get_content_template();
endwhile;
endif;
If I change here, it will reflect in all section/folders that uses category as filter.
So, how could I make the rule to filter post with category id 34 only if its in firstpage and theres no other parameters (there are blocks in first page that uses this block to, so it should be able to work if there is any parameter.The page I need help with: [log in to see the link]
- The topic ‘How to filter recent post by category only in first page block ?’ is closed to new replies.