Site logo

Archived topic

Date with Day after post title in single.php

14 replies · Started by Anil on April 11, 2020

Viewing posts 1–15 of 15

Hi,

Please advise to add Date with Day after post title in single.php as in url i submitted.

Migrating my site to GPP.

Best regards.

Hi there,

you can include the day by selecting Custom date format in Dashboard > Settings > General and adding F j, Y, l

Thanks David, it is working in admin.

I am using Local by Flywheel for fine tuning GPP before update live site.

I noticed date is not populating and showing blank html

<time class="entry-date published" datetime="" itemprop="datePublished"></time>

but populating updated

<time class="updated" datetime="2015-05-18T23:45:14+05:30" itemprop="dateModified">2015, May 18th, Monday</time>
<time class="entry-date published" datetime="" itemprop="datePublished"></time>

Please advise...

Are you using any Functions to adjust the date ?

No.

Hi
I just noticed that wordpress 5.4 can't create or save post if post date is less than 13 Dec 1901, and can't display the post date if post date is less than 14 Dec 1901.

This seems to be a problem with Local by Flywheel ?

Please tell me to place published date above title of the post in single as well as in archive/home

That sounds like something is up with your WordPress installation or server for sure.

As for moving the date - is the date the only item you want to place above the title? Will anything be under the title still?

Hi Tom, I am just checking the issue of local server.

I want to place just date div (no link) above post title, and no other meta below post title.

Best regards

In that case, you can do this:

remove_action( 'generate_after_entry_title', 'generate_post_meta' );
add_action( 'generate_before_entry_title', 'generate_post_meta' );

Then configure your post meta to only display the date in Customize > Layout > Blog.

Thanks Tom

Below code is not blocking/removing the output

remove_action( 'generate_after_entry_title', 'generate_post_meta' )

It is solved with following code

add_action( 'after_setup_theme', function() {
    remove_action( 'generate_after_entry_title', 'generate_post_meta' );
} );

Final help needed to remove link from published date

Thanks & regards

Solved, thanks for all help.

add_filter( 'generate_post_date_output','tu_remove_date_link', 10, 2 );
function tu_remove_date_link( $output, $time_string ) {
	printf( '<span class="posted-on">%s</span>',
		$time_string
	);
}

Glad you got it all working! :)

This archived topic is closed to new replies.