Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Showing time as well as date? #7629

    Matthew
    Participant

    It is yeah thanks Tom! ๐Ÿ™‚

    in reply to: Showing time as well as date? #7482

    Matthew
    Participant

    Hey

    Yeah of course, the code I am using is as follows:

    add_filter( 'wpsp_date_output', function( $output ) {
        $time_string = '<time class="wp-show-posts-entry-date published" datetime="%1$s" itemprop="datePublished">%2$s, %5$s</time>';
    
        if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
            $time_string .= '<time class="wp-show-posts-updated" datetime="%3$s" itemprop="dateModified">%4$s, %5$s</time>';
        }
    
        $time_string = sprintf( $time_string,
            esc_attr( get_the_date( 'c' ) ),
            esc_html( get_the_date() ),
            esc_attr( get_the_modified_date( 'c' ) ),
            esc_html( get_the_modified_date() ),
            get_the_date( 'g:ia' )
        );
    
        return sprintf(
            '<span class="wp-show-posts-posted-on wp-show-posts-meta">
    	    <a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>
            </span>',
            esc_url( get_permalink() ),
            esc_attr( get_the_time() ),
            $time_string
        );
    } );

    The code get_the_date( 'g:i a' ) only seems to be for the time part.

    If you look here – https://www.ukairdates.com at the latest TV shows news at the top of the page it shows the date and time.

    I want to customise how the date looks.

    Thanks for any help you can provide!

    in reply to: Showing time as well as date? #7428

    Matthew
    Participant

    Hey Tom,

    Yeah I did see this but seems to only be to alter the time? Whilst I can add in the date here it still prints the date before this variable.

    How can I alter the date format either before or disable it so I can add it in here?

    Cheers

    in reply to: Showing time as well as date? #7349

    Matthew
    Participant

    Thatโ€™s great thanks, the time is showing now. ๐Ÿ™‚

    I couldnโ€™t see a way in the code though to change the date format. Is this possible?

    Ideally I wanted to shorten the month I know how to do this in PHP date format just not sure where to change this.

    Cheers!

    in reply to: Showing time as well as date? #7308

    Matthew
    Participant

    Hey Tom!

    Great news ๐Ÿ™‚

    I was thinking like the following:

    โ€œ21 Jan 2019, 10.30pm โ€œ

    As an example date in the format Iโ€™d like to achieve.

    Cheers

    in reply to: 2 posts side by side on mobile #6504

    Matthew
    Participant

    That worked great thanks! ๐Ÿ™‚

Viewing 6 posts - 1 through 6 (of 6 total)