Site logo

Archived topic

showing comments link in meta

42 replies · Started by dassana on September 10, 2018

Viewing posts 1–15 of 43

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 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.

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.

done as you have mentioned. disabled the cached plugin.

yes tom, i have removed this code. its not there at all. but still the code given by leo has not worked.

This archived topic is closed to new replies.