This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Show category

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #16246
    sonchasoncha
    Participant

    Hi,

    I would like to show the category of the specific post as post class.
    The reason for that is, that the related posts should get a specific border color for each category they are in.

    Is there a chance to realise that somehow? And if not where can I find the php template to maybe change that with anything like this:

    [code]$categories = get_the_category();
    foreach ( $categories as $category ) {
    echo ‘<div class=".esc_attr($category->cat_name)."><a>term_id ) ).’">
    ‘.esc_html( $category->cat_name ).’
    </a><div>’;
    }[/code]

    Thanks in advance,
    Sonja

    #16258
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi!

    This could be doable by editing the item template. You can find it in the wp-content\plugins\related-posts-pro\includes\views\rpp.shortcode.php file on line 163: https://i.imgur.com/W1uh5E4.png

    #16260
    sonchasoncha
    Participant

    coool, thanks very much! Saved a lot of headaches and my project!!

    Best regards from Vienna
    Sonja

    #16273
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #16274
    sonchasoncha
    Participant

    Sure!
    Thanks for your help!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Show category’ is closed to new replies.