Filtering categories on homepage
Posted 18 April 2012 - 06:07 AM
I am trying to filter out categories on the homepage with the following action:
The code is placed in the base theme's functions.php file, but nothing happens.
Can someone have a look to see if the code is correct?
Posted 18 April 2012 - 03:02 PM
Posted 18 April 2012 - 04:08 PM
To check if "pagelines_inside_top_theloop" is the proper hook, activate the PageLines Action Map plugin on your site and look to see if the hook exists on the home page. (And according to one of the links below, it appears incorrect.)
Next, just guessing here but you probably want a filter, not an action, so you should change that.
Info for learning more about hooks:
Posted 18 April 2012 - 08:57 PM
Posted 19 April 2012 - 12:00 PM
Posted 23 April 2012 - 11:38 AM
This could solve your problem, if you are still looking for a piece of code to exclude categories. Replace the code you pasted in here with the following (in your child theme's functions.php):
Keep in mind that when using "is_home" you are referring to the blog page. If you have a static page set as Home in Setting>Reading you should replace "is_home" with "is_front_page". Of course, don't forget to replace "-1" with whatever category ID you want to exclude.
Posted 24 April 2012 - 12:17 PM