WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to style a current state with CSS to indicate the page currently being viewed, but List category posts doesn't generate a class hook. All it would need is something similar to the solution posted here.

How or where would I modify the plugin or request that the feature to be added?



I'm using eStore 2.9 with a combination of List-Category-Posts and Dynamic Widgets. They all work as expected, but neither List-Category-Posts nor any similar plugin allows me to list posts in a category AND generate a .current class for me to style with. So I'm left with trying to hack (possibly) the plugin to give me current class hook.

And no it's not a homebrewed sidebar. I'd rather the >Menu option in the CP worked its magic.

To recap what I want to achieve: the list-category-post plugin generates a list of links for a given category, like so:

<h4>Category Name</h4>

I want a .current class attached to either the li or a tag of the currently viewed page in the said list:

<h4>Category Name</h4>
<li class="current"><a>Apples</a></li>
share|improve this question
What wordpress function are you using to generate your navigation list or is it home-brewed? – Brady Dec 5 '11 at 14:58
Also, wich theme are you using? – ZweiBlumen Dec 5 '11 at 15:17

Fernando, the plugin's developer, has graciously added the feature to a new version of the plugin. I'm impressed and very grateful.

share|improve this answer

I'm not clear on exactly what you're trying to style, but if you can edit your theme, you can add classes to the body tag which will indicate which page/post/category is being viewed. Look in the header.php file and make sure the body tag looks like this:

<body <?php body_class(); ?>>

Here's the full reference: http://codex.wordpress.org/Function_Reference/body_class#Examples

Best of luck, hope this helps.

share|improve this answer
Thanks for the pointer. And yes I already have that in the body. But it there isn't a corresponding .current class on the category post link there's little that I can do. – Seb Dec 6 '11 at 8:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.