WordPress.org

Ready to get started?Download WordPress

Forums

adding category to link class (2 posts)

  1. mattvenn
    Member
    Posted 4 years ago #

    Hi, I want to have icons next to each internal link that shows what category of post that link is going to take you to.

    To do this I want to add a class to the link code, so instead of

    <a href="xxx">xxx</a>, I get

    <a class="categoryname">xxx</a>.

    Where categoryname is dynamically worked out for each internal link.

    Possible? I've searched the internet and plugins for 30 minutes and not found anything to do this 'out of the box'. However, it seems like
    a pretty easy hack to me.

    Thanks!

  2. s_ha_dum
    Member
    Posted 4 years ago #

    What do you mean by 'internal link'? Are you talking about pages? Category, tag or date archives? All of it? Are you doing this in the sidebar, in the header, inside the Loop?

    Also, got an URL? It helps if you do.

Topic Closed

This topic has been closed to new replies.

About this Topic