Community Forums › Forums › Archived Forums › Design Tips and Tricks › Can't select a specific category in Genesis Blog page template
Tagged: blog page, categories, Sixteen Nine
- This topic has 7 replies, 2 voices, and was last updated 11 years ago by
vangelisbel.
-
AuthorPosts
-
November 8, 2014 at 5:24 am #130885
vangelisbel
MemberHello
I'd like to have only a specific category displaying in my blog page template.
I went to the Genesis menu ---> Theme Settings and I selected the All Posts category I created as seen in the photo below.
However, the Uncategorized category (which I don't want to appear) still appears on page six of my blog (http://www.vangelisphotography.com/blog/page/6/)
Any ideas why this is happening? I'm using Sixteen Nine theme.
Thanks
http://www.vangelisphotography.com/blog/
VangelisNovember 8, 2014 at 5:28 am #130886Genesis Developer
Memberremove those posts from Uncategorized category if you already assigned them.
November 8, 2014 at 5:36 am #130887vangelisbel
MemberThank you genwrock for your reply!
The "Uncategorized" category (or I can name it any other name), is the one I don't want to appear on my blog.
I want the posts under the "Uncategorized" category to be hidden and show up only if someone has the specific URL to them.All the other posts I want to appear on my blog, are under the All Posts category.
When I select the All Posts category to show up, this doesn't work. Instead all categories show up including the Uncategorized one. Hope I didn't confuse you with my description!
November 8, 2014 at 5:39 am #130889Genesis Developer
MemberOk. Then put the “Uncategorized” category ID in the "Exclude the following Category IDs:" textbox
November 8, 2014 at 5:43 am #130892vangelisbel
MemberTried that as well. The ID is 119. I put that in "Exclude the following Category IDs:" textbox and nothing happens...
Maybe it's a plugin or something? Have you heard of something like this before?November 8, 2014 at 6:13 am #130897Genesis Developer
MemberI think that ID is wrong. It will be 1
November 8, 2014 at 1:48 pm #130941vangelisbel
MemberIt's not 1. I know how to find Categories and Tags IDs. Anyway I'll try creating a custom page template of a category.
November 8, 2014 at 2:41 pm #130944vangelisbel
MemberUPDATE
I used the following code (found at http://www.wpstuffs.com/exclude-posts-category-front-page-genesis/) in functions.php and it worked!
/** Exclude certain category from posts */
add_action( 'pre_get_posts', 'be_exclude_category_from_blog' );
function be_exclude_category_from_blog( $query ) {if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'cat', '-156' );
}
} -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.