[Resolved] Date with Day after post title in single.php

Home Forums Support Date with Day after post title in single.php

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1235030
    Anil

    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.

    #1235057
    David
    Staff
    Customer Support

    Hi there,

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

    #1235302
    Anil

    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…

    #1235396
    David
    Staff
    Customer Support

    Are you using any Functions to adjust the date ?

    #1235423
    Anil

    No.

    #1235526
    Anil

    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 ?

    #1235572
    Anil

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

    #1235700
    Tom
    Lead Developer
    Lead Developer

    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?

    #1235799
    Anil

    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

    #1236402
    Tom
    Lead Developer
    Lead Developer

    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.

    #1236469
    Anil

    Thanks Tom

    Below code is not blocking/removing the output

    remove_action( 'generate_after_entry_title', 'generate_post_meta' )

    #1236480
    Anil

    It is solved with following code

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

    Final help needed to remove link from published date

    Thanks & regards

    #1236496
    Anil

    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
    	);
    }
    #1236654
    Tom
    Lead Developer
    Lead Developer

    Glad you got it all working! 🙂

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.