pzproductions
Member
Posted 1 year ago #
I would like to know how to get the comments link code, entrymeta class in this instance, to be invisible or removed on full article view.
It seems silly to have the comments link there when the visitor can already clearly see the comments below the article.
Any help is greatly appreciated. Thanks all!
http://www.pztalks.com/Rift/
The site in question ^^
On line 144 of your style.css change your .entrymeta class to be:
.entrymeta {
display: none;
margin: 5px 0;
text-align: right;
width: 100%;
}
This will hide the comment link.
pzproductions
Member
Posted 1 year ago #
Oh man good to know... you my friend, are epic greatness. Thank you!
No problem, glad to help! :)
Can you mark the post as resolved. Thanks.
pzproductions
Member
Posted 1 year ago #
Wait, I take back some of the genius status lol.
I want the comments link to show on the homepage, just not on the full article... setting the CSS for entrymeta to "display:none" has gotten rid of both.
You don't appear to have many different CSS selectors (id's, classes) that are different between the home page and other pages. This makes it difficult to have different style rules (applied to the same element) across multiple pages.
In this case, your best option is to probably edit your home page theme template and remove the comment link output directly.
In any case I would recommend making any changes to your theme via a child theme to 'future proof' it against theme upgrades.
you need to edit index.php:
find this line:
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »', 'commentslink'); ?>
change to:
<?php if( !is_singular() ) comments_popup_link('No Comments »', '1 Comment »', '% Comments »', 'commentslink'); ?>
http://codex.wordpress.org/Function_Reference/is_singular
(untested; make backup before editing)
pzproductions
Member
Posted 1 year ago #
Thanks for the recommendations guys. As far as the "future proof" against theme upgrades... I typically hard code my themes myself... so upgrades wouldn't be an issue. The theme name is "simpla" because I like the simple and clean code provided for that theme. It makes editing that much easier.
The is_singular codex worked, thanks a bunch alchymyth! I'll be sure to bookmark that link.