-
k.krdha15
Hello sir I want where Author or last updated showing i just add one more thing read time
I put a code where these things done but not in one line
He showing in my case
By Author Name
Last Updated
Read Time
like this but i want like this
3 Mint Read Time, Last Updated: Date, By: Author NameIn one line
and one more code for my first image (feature image)
here I just want when my heading 2 are comes just below of heading two my feature image are shows and this feature image size whuld be (680×382) custom size
now this part is option if you able to provide than i am more happy 👇
and below this feature image a “like” button shows where user like our post and how many time like these post where number shows(mean 10 people like than there at top of like shows 10 Number) and than a comment button show when user click on that comment button they automatically sift(scroll down to go) buttom comment box and
and after these two button {Like, comment} social share button show [First = Whatsapp, Second = Twitter, and third = Telegram and last Facebook]
I am waiting for your reply please provide me simple code i am happy with generatepress theme hope you help me
and one more thing i want to say in my site which i added in private section “”example.com”” like this
in this site last date or by author name are not showing please check that onse as well why there these info not showing -
Fernando
Hi there,
Let’s focus on the Post meta – date and read time in this Topic.
Please open a couple of new topics for the other different issues.
What exact code did you add? Can you try adding this instead to test?:
add_filter( 'generate_post_date_output', function( $output, $time_string ) { $time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published on %2$s</time>'; if ( get_the_date() !== get_the_modified_date() ) { $time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">Updated: %4$s</time> <time class="entry-date published" datetime="%1$s" itemprop="datePublished">Published: %2$s</time>'; } $time_string = sprintf( $time_string, esc_attr( get_the_date( 'c' ) ), esc_html( get_the_date() ), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ) ); return sprintf( '<span class="posted-on">%s</span> ', $time_string ); }, 10, 2 ); function tu_estimated_reading_time() { $post = get_post(); $content = $post->post_content; $wpm = 300; // How many words per minute. $clean_content = strip_shortcodes( $content ); $clean_content = strip_tags( $clean_content ); $word_count = str_word_count( $clean_content ); $m = floor($word_count / 200); $s = floor($word_count % $wpm / ($wpm / 60)); if($m < 1) { $time = $s . ' second' . ($s <= 1 ? '' : 's'); } else { $time = $m . ' minute' . ($m <= 1 ? '' : 's') . ', ' . $s . ' second' . ($s <= 1 ? '' : 's'); } return $time; } add_filter( 'generate_post_date_output', function( $output ) { $output .= '~ ' . tu_estimated_reading_time() . ' to read '; return $output; } );
-
k.krdha15
No, Here time only show in second not in minut even my post is 2000 words
-
k.krdha15
before I using these code [But these not come in a line so thats why asking here]
//reading time
function tu_estimated_reading_time() {
$post = get_post();
$content = $post->post_content;
$wpm = 300; // How many words per minute.$clean_content = strip_shortcodes( $content );
$clean_content = strip_tags( $clean_content );
$word_count = str_word_count( $clean_content );
$time = ceil( $word_count / $wpm );return $time . ‘ minutes’;
}add_filter( ‘generate_post_date_output’, function( $output ) {
$output .= ‘<div class=”read-time”>Reading time: ‘ . tu_estimated_reading_time() . ‘</div>’;return $output;
} );//Post Update Date
add_filter( ‘generate_post_date_output’, function( $output, $time_string ) {
$time_string = ‘<time class=”entry-date published” datetime=”%1$s” itemprop=”datePublished”>%2$s</time>’;if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) ) {
$time_string = ‘<time class=”entry-date updated-date” datetime=”%3$s” itemprop=”dateModified”>Last Updated on: %4$s</time>’;
}$time_string = sprintf( $time_string,
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( ‘c’ ) ),
esc_html( get_the_modified_date() )
);return sprintf( ‘<span class=”posted-on”>%s</span> ‘,
$time_string
);
}, 10, 2 ); -
Hi there,
if you apply the codes you used before, then share a link to a post where I can see the issue.
-
k.krdha15
when i using this code 👇
add_filter( ‘generate_post_date_output’, function( $output, $time_string ) {
$time_string = ‘<time class=”entry-date published” datetime=”%1$s” itemprop=”datePublished”>Published on %2$s</time>’;
if ( get_the_date() !== get_the_modified_date() ) {
$time_string = ‘<time class=”entry-date updated-date” datetime=”%3$s” itemprop=”dateModified”>Updated: %4$s</time>
<time class=”entry-date published” datetime=”%1$s” itemprop=”datePublished”>Published: %2$s</time>’;
}$time_string = sprintf( $time_string,
esc_attr( get_the_date( ‘c’ ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( ‘c’ ) ),
esc_html( get_the_modified_date() )
);return sprintf( ‘<span class=”posted-on”>%s</span> ‘,
$time_string
);
}, 10, 2 );function tu_estimated_reading_time() {
$post = get_post();
$content = $post->post_content;
$wpm = 300; // How many words per minute.$clean_content = strip_shortcodes( $content );
$clean_content = strip_tags( $clean_content );
$word_count = str_word_count( $clean_content );
$m = floor($word_count / 200);
$s = floor($word_count % $wpm / ($wpm / 60));
if($m < 1) {
$time = $s . ‘ second’ . ($s <= 1 ? ” : ‘s’);
} else {
$time = $m . ‘ minute’ . ($m <= 1 ? ” : ‘s’) . ‘, ‘ . $s . ‘ second’ . ($s <= 1 ? ” : ‘s’);
}return $time;
}add_filter( ‘generate_post_date_output’, function( $output ) {
$output .= ‘~ ‘ . tu_estimated_reading_time() . ‘ to read ‘;return $output;
} );than see like this image i share with you
-
Fernando
Can you share a link to a Post on your site with the code enabled?
-
k.krdha15
Please check sir i have added your code and give you a url
https://navhindi.com/pf-form-me-father-mother-name-correction-kaise-kare/
-
k.krdha15
Now please check i will provide you wordpress access too
-
Add this CSS to your site:
.single .entry-meta { display: flex; flex-wrap: wrap; column-gap: 10px; } .read-time { order: -1; } .single .entry-meta > * { display: block; }
-
k.krdha15
please try using login id pasword from your side
still this not working login id are given belo -
can you disable WP Rocket and any other cache plugins so i can inspect the sites code.
-
k.krdha15
ok id do check now
-
k.krdha15
also i give you to full permission please solve this issue i already giveing you login id so not asking to me please solve issue
-
Fernando
Sorry, we don’t make actual changes on our customers’ sites even when we have login credentials.
Plugin-disabling related, this is for safety purposes since we are unsure if our customers have backups of their sites in case anything breaks.
In any case, this is how I’m seeing the Time to read on the Post you shared: https://share.getcloudapp.com/jku6qOYb
Is this correct? If not, can you explain how you want it to show or how it’s incorrect?
-
k.krdha15
now i am live
- You must be logged in to reply to this topic.