Home › Forums › Product Support Forums › Related Posts Pro for WordPress Support › Show category
This topic contains 4 replies, has 2 voices, and was last updated by soncha 6 years, 3 months ago.
- AuthorPosts
- January 10, 2018 at 3:45 pm #16246
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:
$categories = get_the_category(); foreach ( $categories as $category ) { echo '&lt;div class=".esc_attr($category-&gt;cat_name)."&gt;<a>term_id ) ).'"&gt; '.esc_html( $category-&gt;cat_name ).' </a>&lt;div&gt;'; }
Thanks in advance,
SonjaJanuary 11, 2018 at 11:52 am #16258Hi!
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
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 11, 2018 at 12:57 pm #16260coool, thanks very much! Saved a lot of headaches and my project!!
Best regards from Vienna
SonjaJanuary 12, 2018 at 12:47 pm #16273You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
January 12, 2018 at 12:50 pm #16274Sure!
Thanks for your help! - AuthorPosts
The topic ‘Show category’ is closed to new replies.