[Resolved] entry-meta

Home Forums Support entry-meta

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1262431
    Fekry

    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

    #1262872
    David
    Staff
    Customer Support

    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

    #1262908
    Fekry

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

    #1263928
    Leo
    Staff
    Customer Support

    Your site is under the coming soon page.

    Can you disable it?

    Thanks!

    #1265970
    Fekry

    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: “;
    }
    …………………………………..

    #1266400
    Leo
    Staff
    Customer Support

    Add this PHP snippet:

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

    Thanks Leo. It works perfect.

    #1266763
    Leo
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.