Site logo

Archived topic

Hi, I want to show "Author/updated date

46 replies · Started by Rahul on February 1, 2021

Viewing posts 1–15 of 47

Hi, I want to show "Author/updated date" below the post title. How can I do that with the "GP theme"?

I have applied these codes, but it doesn't work. And I want to show Author name and updated date.

Already I enabled all options from these two "Archives + Single" But nothing shows there. You can check the site I attached before.

Already I enabled all options from these two “Archives + Single” But nothing shows there. You can check the site I attached before.

I've checked the site and time elements doesn't seem to have the time strings rendered.

This usually happens when users set a custom format with a syntax issue for the date set under Dashboard > Settings > General.

You can try checking this out if this is the case. Try testing w/ the default time format.

Let us know.

I changed the time format with date, but nothing changed. If you want I can add you to my site for a better investigation.

In your Customizer > Additional CSS you have this rule which is hiding the meta:

.entry-meta {
    display: none;
}

Delete that to display the meta.

Yes, it's working now. But before the date, I want to add this text "Last updated on" How can I add this? And the updated date will show on google search?

This doc provides the PHP Snippet for only displaying the last updated date:

https://docs.generatepress.com/article/generate_post_date_show_updated_only/

And to add the Last Updated label before it you would add this snippet:

add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) {
	if ( 'date' === $item ) {
        return 'Last updated on ';
    }
    return $output;
}, 50, 2 );

Adding PHP: https://docs.generatepress.com/article/adding-php/

Those changes will make it so only the last update timestamp is output .... what google does with that data is up to google

Without a plugin can I put those codes? And where should I put in my site?

Hi, I just installed the "Code Snippet" plugin and I opened the "Order snippets by date" But I didn't put any codes in the plugin. Is it right? You can visit the site.

This archived topic is closed to new replies.