Category post count within sidebar link?
-
I’ve added the Category widget to my sidebar and I’ve opted to show the category count as well. Is there any way, by tweaking the php or whatever, to have that included within the category title link rather than just outside?
-
Thanks for this – that’s exactly the problem I’m faced with but I’ve no idea where I’m supposed to insert that code? It’s on the widgets.php file that the “Display categories widget” resides on but I can’t see any mention of any of the code that it talks about on that site? Any ideas?
Sorry that isn’t for a widget, but rather code you would put in your theme’s sidebar.php.
Related:
Stepping Into Template Tags
Stepping Into Templates
Template HierarchyOkay, thanks. Looks like I’ve got a fair bit of reading to do to resolve this issue – I would have thought it would be incredibly simple to add the amount of posts within the link tag?!
Okay, I almost managed to do this. In the classes.php (in the wp_includes folder) I changed the line from:
$link .= $cat_name . '';to
$link .= $cat_name ;This seems to work in all browsers with the exception of IE6 as it seems to mess up the formatting of the sidebar?!
Sorry, I can’t seem to write that post without it messing up the formatting – the ” should be a closing link tag.
Has anybody got any ideas on how to do this?
Does anyone know why with the method I mentioned a few posts ago why this would function perfectly okay in all browsers except IE6 – If IE6 didn’t exist then I would have found the answer but as it does then I need to figure out a different way.
I’m amazed nobody else is experiencing this or wanting to do what I’m wanting to do. Anyone?
The topic ‘Category post count within sidebar link?’ is closed to new replies.