• Resolved akifall

    (@akifall)


    I’ve seen quite a few posts on this but they all didn’t answer my question the way I wanted it to. Currently my categories looks something like this:

    events
    (1)

    I know this is due to me using the display: block css style but was wondering if there was a way to get the (1) as a link as well? That way it’ll all be in one line. I know I’ll probably have to edit the wp-includes/template-functions-category.php a little.

    I’ve seen someone else do it just have no idea how they did it. Any help will be appreciated and sorry if this has been asked already, I’m not really sure what to search for.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Make the <li> display: block, not the <a>?

    Thread Starter akifall

    (@akifall)

    Thanks for replying maerk! I actually want the whole li to ‘light’ up if you know what I mean.. that’s why I used display: block on the <a>

    Ah right, I see. Hmmm… you might try floating the <a> then, that way it would still be block, but would float to the left.

    That’s what I’d try. You’ll have to mess around with the CSS to stop it from interfering with all the other bits and pieces on the page, though. clear: both; on the <li>s I shouldn’t wonder…

    Oh, and the other thing is that the post count won’t light up when you hover over the link, because it’s not inside the <a>.

    Thread Starter akifall

    (@akifall)

    ^ Is there a way to get the post count inside the <a>? That’s what I wanted to know. I’ve taken a look at the code but haven’t done anything to it yet to try.

    I’ll try what you suggested and see o.o hope it works.

    Hi akifall.

    I’m guessing that on your sidebar, you have the li <a> tag with a display:block; and thus lies your problem.

    If you just removed the display:block from your <a> tag (you’ll need to look into the CSS stylesheets) then the post count will be on the same line as the category name but you’ll then lose the block effect.

    Can’t have the best of everything… ??

    Hope this helps. Cheers~!

    Thread Starter akifall

    (@akifall)

    Hehe yes it does help, I actually know what the problem is already. Just I wanted to know if anyone knew how to change the wp-include file so that the (1) <– post count ends up being a link as well but it’s ok ??

    Hi all!

    Sirs
    I am really need to provide category postings count numbers inside
    a element container instead of li.

    I can do this by editing template-functions-category.php file

    in lines

    330 (deleting a leave blank in ”)
    362 (adding a (in brackets) to intval($category->category_count).’)’

    But is it safe? I doubt ??
    It works but, lets say in feature editions i forget about this and wants to add images to categories.

    Is there best, preffered or simply safe method to add category counts in a element?

    Any thinks are welcome, thanx

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How to get category post counts to be in one line’ is closed to new replies.