Community Forums › Forums › Archived Forums › General Discussion › blog page template won't exlude categories
Tagged: blog page template
- This topic has 14 replies, 2 voices, and was last updated 10 years, 2 months ago by
Brad Dalton.
-
AuthorPosts
-
September 11, 2013 at 2:56 pm #62009
dompalmer
MemberHi,
I've created a standard child theme for Genesis and am trying to limit the categories displayed on the blog page template to just one: 'news'. I've tried this through the theme options via the blog page template tab but the page will only display all categories whether I choose to display only one or omit the others. Is there something I'm missing with this?
Many thanks in advance!
http://arete.dominicpalmer.co.uk/latest-news/September 12, 2013 at 1:37 am #62067Brad Dalton
ParticipantSeptember 12, 2013 at 1:04 pm #62135dompalmer
MemberThanks for the swift response Brad. I'm afraid it didn't work however. I placed the code into the functions.php file and changed the category from '-007' to '-002' (as my blog category that I want to keep is has the ID of 2) but the page is still displaying all of them.
Any other thoughts at all would be much appreciated
Many thanks
September 13, 2013 at 1:05 am #62211Brad Dalton
Participant007 is in reference to 007 the actor and movie. Its a placeholder number.
You will need to replace that with your i.d which is 2.
Not 002 because i think he's been replaced!!
September 14, 2013 at 12:18 pm #62545dompalmer
Memberhaha! Ok I now understand...
I've added your code but am having now luck again I'm afraid - All categories are still displaying http://arete.dominicpalmer.co.uk/latest-news/
Just to clarify. The category I want to exclusively display is '2' so I have adapted the code here
Am I missing something??
Many thanks again
September 14, 2013 at 12:46 pm #62547Brad Dalton
ParticipantSeptember 14, 2013 at 12:54 pm #62548dompalmer
MemberWell spotted and thanks again for your persistence... however it still hasn't done it. All categories still displaying.
Could I have altered something else that has had a knock on effect? There's every possibility I've edited something without realising...
Many thanks
September 14, 2013 at 12:57 pm #62550Brad Dalton
ParticipantMaybe. What have you set in the Genesis > Theme Settings > Blog Page Template?
September 14, 2013 at 1:10 pm #62552dompalmer
MemberThe option there is set to 'news' also. It doesn't have any effect on the filter regardless of what I set it to unfortunately
September 14, 2013 at 1:18 pm #62554Brad Dalton
ParticipantIt should work so there must be a problem. Try deactivating all your plugins and see what happens.
Then you can activate them one by one to see if its a plugin conflict.
September 14, 2013 at 1:40 pm #62557dompalmer
MemberStill no joy 🙁 I turned them all off but the problem persisted.
I must've messed with something here but can't think what.
Do you think an alternative might be just to set up a new page template to only feed the one category? Seems a bit drastic but...
September 15, 2013 at 2:28 am #62606Brad Dalton
ParticipantChange the conditional tag:
is_page('blog')
To the page i.d for your blog which can can grab from the source code in the body tag section.
September 15, 2013 at 9:46 am #62636dompalmer
MemberThanks Brad - I haven't tried it yet but I think you've found the issue
I got the page working using a workaround. I selected the blog template file and added
query_args: cat=1 into the custom fields
this did the trick in the short term - Many thanks again for your help with this one
September 20, 2013 at 5:06 am #63505Brad Dalton
ParticipantJust tested this code and it works on the home page.
Note: You'll need to change the conditional tag and the category i.d in the code.
September 26, 2013 at 12:28 pm #64319Brad Dalton
ParticipantNote: Use of the is_home() conditional tag depends on your Reading Settings.
If your Reading Settings are set to: Front page displays > Your latest posts, then the is_home() conditional tag will return true for your front page.
If your Reading Settings are set to: Front page displays > A static page (select below) , then the is_home() conditional tag will return true for your blog page and not your Front Page.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.