- This topic is empty.
-
AuthorPosts
-
May 21, 2011 at 10:37 am #32820hirokMember
Hi All. I have a question about the designing the date stamps. Back in the day, I could edit the index.php file of the theme directory to design the date stamp by searching for the_time. I use Starkers naked WordPress theme. I read on another website that I could just replace timesince() ?> ago at with at .
Can someone please teach me what file I need to edit and what piece of code I need to edit to design the date stamp?
I thought the only files I need to really edit were the header.php, sidebar.php and footer.php. Anyway, Thank you in advance for your help. I really appreciate it
May 21, 2011 at 11:13 am #75597ccc630MemberI believe you’re going to find that in the single.php file:
This entry was posted
You'll need to download this plugin, and follow the instructions:
http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */
/* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
on at
and is filed under .
Hope that helps. As an aside, if you start digging into other themes, you might find the date/time info in the meta.php file.
May 21, 2011 at 5:38 pm #75606hirokMemberThis is fantastic. I will be trying this out and thank you so much ccc630!!!
May 23, 2011 at 1:28 am #75520ccc630MemberGlad to help. It also occurred to me that you might want/need to add whatever time stamp verbage you settle on, to the Loop on the index page as well (if you’re keeping the loop on the index page, and if you want the same time stamp there. :)
May 23, 2011 at 10:07 am #75498hirokMemberI did a search in the whole theme folder for
... and the search showed that there was no code for the_time in any of the files. That includes single.php and loop.php. This is what my single.php looks like and I'm at a loss.
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Starkers
* @since Starkers 3.0
*/
get_header(); ?>
'' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>
">
May 23, 2011 at 11:26 am #75492ccc630Memberhmmm….either I have an out-dated version of Starkers in my files (entirely possible) or…I don’t know. Can’t research right now, but will try to dig deeper tonight. First impulse is to look for the twentyten_posted_on function and edit that, but dunno.
May 24, 2011 at 12:02 pm #75581TheDocMemberYour theme could also be using the_date();
May 26, 2011 at 3:52 pm #75230jacorreParticipantMight be in the functions.php file for your theme.
June 1, 2011 at 5:10 pm #74619hirokMemberThank you. I looked in functions.php and found it. I was able to modify the date format. I used http://us.php.net/manual/en/function.date.php to figure out how I want my date formatted.
I tried to design this section using div and css but they didn’t work. I thought I could split up the lines like:
get_the_date('M')
get_the_date('jS')
get_the_date('Y')
but it doesn’t work. Below is what the code currently looks like. So I’m trying to figure out how I can design this date stamp.
Thanks again :)
if ( ! function_exists( 'twentyten_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post—date/time and author.
*
* @since Twenty Ten 1.0
*/
function twentyten_posted_on() {
printf( __( 'Posted on %2$s by %3$s', 'twentyten' ),
'meta-prep meta-prep-author',
sprintf( '%3$s',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date('M jS Y')
),
sprintf( '%3$s',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
get_the_author()
)
);
}
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.