Viewing 1 replies (of 1 total)
  • Thread Starter jianchen

    (@jianchen)

    Problem Solved:

    You must edit the template-tags.php to fix the missing author and update from google console.

    First Locate the file using your file manager. Create a backup first before editing the file.

    /wp-content/themes/editorial/inc/template-tags.php

    To fix the Missing Updated locate this code.

    function editorial_posted_on() {
    	$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
    	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    		$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
    	}

    then replace this code:

    function editorial_posted_on() {
    	$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
    	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    		$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>';
    	}

    To Fix the missing Author locate this code again:

    $byline = sprintf(
    		esc_html_x( '%s', 'post author', 'editorial' ),
    		'<span class="author vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
    	);

    Then replace it with this code:

    $byline = sprintf(
    		esc_html_x( '%s', 'post author', 'editorial' ),
    		'<span class="vcard author post-author"><span class="fn"><?php the_author(); ?></span></span>
    		<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
    	);

    Then save changes. I hope this helps everyone here.

    • This reply was modified 6 years, 5 months ago by jianchen.
    • This reply was modified 6 years, 5 months ago by jianchen.
Viewing 1 replies (of 1 total)
  • The topic ‘Missing: author Missing: updated’ is closed to new replies.