WordPress.org

Ready to get started?Download WordPress

Forums

P2
P2 Theme -- remove time from posts (2 posts)

  1. John Davey
    Member
    Posted 2 years ago #

    I searched the forum and could not find this answer:

    How do I modify the P2 theme so that only the date of a post is displayed, not the time?

    I tried editing the line below in the Main Index Template, index.php, but it did not do the job for me:

    '<?php printf( _x( 'Updates from %s', 'Month name', 'p2' ), get_the_time( 'F, Y' ) ); ?>'

    Thanks.

    http://wordpress.org/extend/themes/p2/

  2. Lance Willett
    Themer
    Posted 2 years ago #

    Look in inc/template-tags.php near line 240, and just remove the time output.

    It looks like:
    return '<abbr title="'.$d( 'Y-m-d\TH:i:s\Z', true).'">'.sprintf( __( '%1$s <em>on</em> %2$s', 'p2' ), $d(get_option( 'time_format' )), $d( get_option( 'date_format' ) ) ).'</abbr>';

    Change it to something like:

    return '<abbr title="' . $d( 'Y-m-d', true ).'">' . $d( get_option( 'date_format' ) ) . '</abbr>';

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags