• <!-- wp:categories -->
    
    <li class="cat-item cat-item-9">
    <a href="#">MENU</a> (1)
    </li>

    Looking at how this function is marked up, there is no way to customize it.

    I don’t know why the post count was designed to be like this, but I have to use javascript to separate the menu and count parts.

    Is there a way to do this that I don’t know about?

    <li class="cat-item cat-item-9" data-count="1">
    <a href="#">MENU</a>
    </li>
    
    or
    
    <li class="cat-item cat-item-9">
    <a href="#">MENU</a>
    <span>1</span>
    </li>

    I expected something like this, but was surprised to see a completely different result.
    Whatever it is, it doesn’t matter as long as there is a way to control it.

    Could you please help?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Looking at how this function is marked up, there is no way to customize it.

    Looking at the markup you posted, the category name is linked, whereas the count is not.

    That should be sufficient to style the two differently.

    Thread Starter devpandaking

    (@devpandaking)

    @gappiah

    Thank you for answer.


    But I cannot agree with you.
    “(1)” There is no way to select this part with a “css selector”, so you must manipulate the parent’s style to specify the style.

    And “(1)” To express this part as “1”, it is absolutely impossible without the help of javascript.

    I am curious as to how you think this is possible.

    • This reply was modified 10 months, 2 weeks ago by devpandaking.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I customize “wp:categories”’ is closed to new replies.