I would like to show only posts that are labeled as a particular category and ignore the rest. I think I need to do something with Theme Filters, but I have no clue where to start.
Please help! Thanks!
Jane
I would like to show only posts that are labeled as a particular category and ignore the rest. I think I need to do something with Theme Filters, but I have no clue where to start.
Please help! Thanks!
Jane
I tried the below code and it does NOT work. I am not sure how to edit the loop so it would show posts only related to one category. Please help me solve this issue.
/*
*
* Show only posts marked as 'front' category to show on the homepage
*
*/
function childtheme_content($content) {
if (is_home() || is_front_page() || is_archive()) {
if( is_category('101')){
$content= 'full';
}
else{
//Don't show anything
$content= 'none';
}
}
return $content;
}
add_filter('thematic_content', 'childtheme_content');
Thanks!
Just as a clarification, above code shows full posts for post labeled as category 101 and only title + meta information about other posts. However, I would like to not show other posts at all. How do I do that?
Thanks
Ok finally figured it out. I added the following in my functions.php file
/*
*
* Show only posts marked as 'front' category to show on the homepage
*
*/
function only_front_posts() {
if(is_home()|| is_front_page()) {
query_posts ($query_string . '&cat=101');
}
}
add_action('thematic_above_indexloop','only_front_posts');Thanks for sharing your solution :)
This topic has been closed to new replies.