Viewing 3 replies - 1 through 3 (of 3 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hello unster,

    Follow below instructions:

    1. Navigate to General settings (Dashboard >> Settings >> General).
    2. Select H:i format from Time Format option and save changes.

    Screen Shot

    Hope this will helps you.

    Thanks.

    Thread Starter unster

    (@unster)

    Hi,
    I have all those settings like you have, but the theme itself just shows date only.

    Hi,

    Put this code snippet into your child theme’s functions.php file, it will change the post date including the time.

    	function sparkling_posted_on() {
    		$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time>';
    		if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    			$time_string .= '<time class="updated" datetime="%3$s">%4$s</time>';
    		}
    
    		$time_string = sprintf( $time_string,
    			esc_attr( get_the_date( 'F j, Y g:i a' ) ),
    			esc_html( get_the_date( 'F j, Y g:i a' ) ),
    			esc_attr( get_the_modified_date( 'c' ) ),
    			esc_html( get_the_modified_date() )
    		);
    
    			printf( '<span class="posted-on"><i class="fa fa-calendar"></i> %1$s</span><span class="byline"> <i class="fa fa-user"></i> %2$s</span>',
    				sprintf( '<a href="%1$s" rel="bookmark">%2$s</a>',
    					esc_url( get_permalink() ),
    					$time_string
    				),
    				sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s">%2$s</a></span>',
    					esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    					esc_html( get_the_author() )
    				)
    			);
    	}

    Let us know,

    Thanks,
    laranz.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Include time in post date’ is closed to new replies.