Need to add class to article tag when it's a excerpt in TwentyEleven content.php
-
Hi,
I want to use a different comment-bubble image for the excerpts that appear on the category.php page under the first full post. However, I can’t target them as there is no separate class or id to identify the comments-link class in the excerpt. Both full post and excerpts have the same classes in the Twentyeleven content.php.
<article id="post" etc. > <header class="entry-header"> <div class="comments-link">
I’ve been able to add the class ‘excerpt’so I can target the actually text of the excerpt. But I want to add a class to < article > when it’s an excerpt so I can target the comment_link class.
So something along the lines of
<article id="post-<?php the_ID(); ?>" <?php post_class(<IF IS_EXCERPT ADD 'excerpt'); ?>>
The relevant code in content.php in my Twentyeleven child theme is currently as follows:
[code moderated - please follow the guidelines under https://codex.www.ads-software.com/Forum_Welcome#Posting_Code when posting code]
Thanks for your help in advance
- The topic ‘Need to add class to article tag when it's a excerpt in TwentyEleven content.php’ is closed to new replies.