Site logo

Archived topic

I need to change the date format and show the most recent update

9 replies · Started by Andre Lasnor on May 30, 2021

Viewing posts 1–10 of 10

I need to show the author's name with the link and publication date as follows:

Por Author | Publicado em DD/MM/YYYY às HH:MM

How do I do that?

It worked, but it is showing an error message.

"Warning: Use of undefined constant db_modified_time_stamp - assumed 'db_modified_time_stamp' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\tecnomais\wp-content\themes\generatepress_child\functions.php on line 8"

And I still need to change the date with the author of the place.

It worked, but it is showing an error message.

“Warning: Use of undefined constant db_modified_time_stamp – assumed ‘db_modified_time_stamp’ (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\tecnomais\wp-content\themes\generatepress_child\functions.php on line 8”

This isn't an error. That's just a warning that shows up because you have wp_debug enabled. You should turn this off when it isn't needed.

And I still need to change the date with the author of the place.

Author is a separate meta item, if you need to modify the author post meta output you can use the generate_post_author_output filter. https://github.com/tomusborne/generatepress/blob/b60b853630da6d9015722da903e53c8064148b0a/inc/structure/post-meta.php#L220

I'm not exactly sure what you're trying to do with this though. If you simply what to add | between the post meta items, we can do that with CSS as well.

wp_debug is not enabled. It is found as follows in wp-config.php:

define( 'WP_DEBUG', false )

In the second part I want the author to appear before the date:

By Author | Published on DD / MM / YYYY

I was testing the code on a site installed on localhost with Xampp and I was getting this error, but I tested it on an online website and it worked perfectly so that part has already been resolved, thanks.

The second thing I had said was that I wanted to display the author first and then the publication date.

The second thing I had said was that I wanted to display the author first and then the publication date.

We can sort this out by filter.

Example:

add_filter( 'generate_header_entry_meta_items', function() {
    return array(
        'author',
        'date',    
        'categories',
    );
} );

We basically have to sort in this PHP filter's array how the post meta items are arranged.

It worked perfectly, thank you very much for your help.

No problem. Glad to be of any help. :D

This archived topic is closed to new replies.