Site logo

Archived topic

entry: updated published for static page

2 replies · Started by Anonymous on June 23, 2015

Viewing posts 1–3 of 3

Dear Tom,
your job is amazing :)

I have a little suggestion, my site use only static pages and my searchconsole in Google complain the lack of author, published and updated fields in the hatom/entry tag, I solved putting the following in the content-page.php after entry-title:

echo '

';

$time_string = '<time class="published" datetime="%1$s" >%2$s</time>';
time_string .= '<time class="updated" datetime="%3$s" >%4$s</time>';

$date = date('c', time());

$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date( 'c' ) ),
esc_attr( $date ),
esc_html( $date ));

echo $time_string;

echo '<span class="author vcard"><span class="fn org">Your Name</span></span>';

echo '

'

Could it be putted in the next update so to avoid modifing again the code or something equivalent so solve the problem?

Thank you very much :)

note: everything was enclosed in "div style display none" but this forum parser removed it

In general, pages don't usually have a visible author name. If I were to add this in the next update, I would probably get quite a few angry people asking me why their author name was all of sudden showing on their pages.

Those three fields (author, published date and modified date) are typically only present on blog posts - GP does add them there by default.

Of course, as long as you added the above code into your child theme, it will work perfectly for you going forward, even if you update GP :)

This archived topic is closed to new replies.