Archived topic
showing comments link in meta
42 replies · Started by dassana on September 10, 2018
hi
i searched the forum and added the codes given on this link - https://gist.github.com/generatepress/a07fbf6ae38a490c1d6e
however the comment link is not seen even after adding the css codes as mentioned by tom.
i have shared a recipe link below. i also want all the meta in one line, center aligned and in regular normal font. but even after changing the css code, the meta font remains bold.
Hi there,
Can you try this instead?
https://generatepress.com/forums/topic/changing-blog-styles/#post-582980
Let me know :)
hi leo
tried this code, but its not working.
Hmm ok let's try this PHP:
add_filter( 'generate_post_date_output', 'lh_single_comments_link' );
function lh_single_comments_link( $date ) {
echo $date;
if ( is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '<span class="comments-link">';
comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) );
echo '</span>';
}
}
With this CSS:
.single .comments-link {
display: inline-block;
}
even this php code along with the css code is not working. anything else that can be added.
Hmm I actually tested that code and it worked for me.
Is it added currently?
no. i removed it. i disabled cache plugin and tried again, but its not getting reflected on the post.
Are you using any custom function to alter the meta currently?
Unfortunately it's not possible for me to debug when the code is removed since it worked for me:
https://www.screencast.com/t/mqI3hTPy
yes i am using custom function. i have added the code given by you now, so you can debug it. also added the css code which you have given.
Can you try this method to show the modified date?
https://docs.generatepress.com/article/show-the-updated-post-date/
leo, currently i am showing this one
.posted-on .updated {
display: inline-block;
}
.posted-on .published {
display: none;
}
.posted-on .updated:before {
content: "LAST UPDATED: ";
}
tried the one you gave just now but its not displaying properly.
You will need both the code here:
https://generatepress.com/forums/topic/showing-comments-link-in-meta/#post-673799
https://docs.generatepress.com/article/show-the-updated-post-date/
Can you leave it both in and disable the caching plugin?
done as you have mentioned. disabled the cached plugin.
Just to confirm, have you removed this code?: https://gist.github.com/generatepress/a07fbf6ae38a490c1d6e
It would need to be removed in order for the code Leo linked to to work.
yes tom, i have removed this code. its not there at all. but still the code given by leo has not worked.