Site logo

Archived topic

entry-meta

7 replies · Started by Fekry on April 30, 2020

Viewing posts 1–8 of 8

Hi there
I need to change " by " in entry-meta to " | "
Example: change (10 April 2020 by Fekry Abdeen) to (10 April 2020 | Fekry Abdeen)
What should I do?
Thanks in advance

Hi there,

have you already added any code to change the way the author and date are displayed? And can i possibly see the website

Hi David.
I"ve put "PhP" and "CSS" for showing "Updated" into posts and google search.
You may please check the site now.

Your site is under the coming soon page.

Can you disable it?

Thanks!

Hi, may you check my site now?
Note: I use this "PHP" and "CSS" to show updated on "posts and google search":
................................
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>';

$updated_time = get_the_modified_time( 'U' );
$published_time = get_the_time( 'U' ) + 3600;

if ( $updated_time > $published_time ) {
$time_string = '<time class="entry-date updated-date" datetime="%3$s" itemprop="dateModified">%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 );
.........................................
.updated-date:before {
content: "Updated on: ";
}
.........................................

Add this PHP snippet:

add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) {
	if ( 'author' === $item ) {
        return ' | ';
    }
    return $output;
}, 50, 2 );

Thanks Leo. It works perfect.

No problem :)

This archived topic is closed to new replies.