Support » Plugin: WP Show Posts » Inject class into link category markup

  • Resolved George

    (@quantum_leap)


    I want to inject a class name on the shown linked categories (terms) markup that is identical with the category name. For example, I want this generated code:

    <div class="wp-show-posts-entry-meta wp-show-posts-entry-meta-below-post post-meta-stack">
    <span class="wp-show-posts-terms wp-show-posts-meta">
    <a href="https:mysite.com/category/entertainment/" rel="tag">Entertainment</a>,
    <a href="https:mysite.com/category/lifestyle/" rel="tag">Lifestyle</a></span></div>

    to become this:

    <div class="wp-show-posts-entry-meta wp-show-posts-entry-meta-below-post post-meta-stack">
    <span class="wp-show-posts-terms wp-show-posts-meta">
    <a class="entertainment" href="https:mysite.com/category/entertainment/" rel="tag">Entertainment</a>,
    <a class="lifestyle" href="https:mysite.com/category/lifestyle/" rel="tag">Lifestyle</a></span></div>

    Is there a magical hook I could use?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,

    is this purely for styling the term links ?

    If so you could target them like so:

    .wp-show-posts-meta a[href*="entertainment"] {
        /* styles for entertainment link */
    }
    George

    (@quantum_leap)

    Ah, of course, perfect!

    Thank you, David!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.