Recent Topics

1 Aug 04, 2005 21:47    

How can I move the post date for a blog entry?

What I want to do is move it from the top and have the date next to the title of the blog entry. Like so

8/4/05 "Title of blog"

Thanks
john

2 Aug 05, 2005 00:11

Since you haven't given a link for us to look at, I'll have to make the wildest stab in the dark known to man.

Open _main.php in an editor and find

<?php // START POSTS
if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post
if( isset($MainList) ) while( $Item = $MainList->get_item() ) {
	locale_temp_switch( $Item->locale ); // Temporarily switch to post locale
	$MainList->date_if_changed(); // display post date if it changed
	$Item->anchor(); // Anchor for permalinks to refer to
	?>

And change it to

<?php // START POSTS
if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post
if( isset($MainList) ) while( $Item = $MainList->get_item() ) {
	locale_temp_switch( $Item->locale ); // Temporarily switch to post locale
	//$MainList->date_if_changed(); // display post date if it changed
	$Item->anchor(); // Anchor for permalinks to refer to
	?>

Then add the following code next to the piece of code that makes the title - $Item->title I believe.

<?php $Item->issue_date('j/n/y'); ?>

The formatting for the date is taken from php.net and searching for date. If you just want to use the default formatting for the locale, just delete the 'j/n/y' part. Keep the brackets though.

3 Aug 05, 2005 20:09

Graham, first off my apologies about not giving you a link to look at. And thanks for the help.

I had tried just moving that sniplet of code but it went right back to the default. I'm gonna give this a try, hopefully it will do what I want.

Thanks,
John


Form is loading...