• I have the following:

    <?php
    			endif;
    
    			if ( is_single() ) :
    
    				the_time( 'F j, Y');
    				the_title( '', '</h1>' );
    			else :
    				the_time('F j, Y');
    				the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
    
    			endif;
    		?>

    I’d like to have <h1 class=”entry-title”> before the_time( ‘F j, Y’); part, but I cannot figure out how to place this within the php, BEFORE the time, rather than the title. Should I place it in another variable before the_time or should I find a place to put it within the the actual the_time variable?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Azimuth Ninja

    (@azimuth-ninja)

    I can’t see exactly why this doesn’t work?
    the_time( '<h1 class="entry-title">', 'F j, Y');

    Thread Starter Azimuth Ninja

    (@azimuth-ninja)

    Did it like this:

    if ( is_single() ) :
    				_e( '<h1 class="entry-title">' );
    				the_time( 'F j, Y');
    				the_title( '', '</h1>' );

    Works!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding html to the_time( 'F j, Y');’ is closed to new replies.