Is it possible to hide the ‘more’ tag on portfolio items (just in template-portfolio.php) where there are featured images, but no text content or excerpt? Some of my portfolio items have extensive text, and some have none.
open up template-portfolio.php and delete following code:
echo "<a href='".get_permalink()."' class='more-link'>".__('Read more','habitat')."</a>";
Thanks for the reply! Unfortunately, that will remove ALL more links on the template-portfolio.php page. I only want to remove the more link when there is no exerpt or content text. For those portfolio entries with text, I want to keep the more tag.
That’s not easily possible. It would require a function which checks every content/excerpt first and based on the result you’d need to modify the read more button behaviour. Because wp adds some html tags to the content (even if the text editor field appears to be empty) you’d need to filter it first….
The topic ‘Remove 'Read More' for portfolio items with images but no text content’ is closed to new replies.