Tagged: blog page template
September 11, 2013 at 2:56 pm #62009
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 #62067September 12, 2013 at 1:04 pm #62135
Thanks 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 thanksSeptember 13, 2013 at 1:05 am #62211
007 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 #62545
haha! 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 againSeptember 14, 2013 at 12:46 pm #62547
You missed the -
So it should be -2
Should work now.
September 14, 2013 at 12:54 pm #62548
Well 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 thanksSeptember 14, 2013 at 12:57 pm #62550
Maybe. What have you set in the Genesis > Theme Settings > Blog Page Template?
September 14, 2013 at 1:10 pm #62552
The option there is set to 'news' also. It doesn't have any effect on the filter regardless of what I set it to unfortunatelySeptember 14, 2013 at 1:18 pm #62554
It 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 #62557
Still 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 #62606
Change the conditional tag:
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 #62636
Thanks 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 oneSeptember 20, 2013 at 5:06 am #63505
Just 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 #64319
Note: 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.
- The forum ‘General Discussion’ is closed to new topics and replies.