Recent Topics

1 Aug 06, 2005 08:08    

when i was making my layout i lost the php code that contained the author of that posts name.

what code do i need to incert to make the authors name show up with the post again?

also,

<?php 
	if( isset($MainList) ) $MainList->display_if_empty(); // Display message if no post

	if( isset($MainList) ) while( $Item = $MainList->get_item() )
	{
		$MainList->date_if_changed();

	?>


That displays my date as "04/18/05", how do i display that in "April-16-05" format?... and for some reason my CSS doesnt resize that part, but it changes everything else in the same ID as that.

so how do i change that format and the text size of it?

2 Aug 06, 2005 15:50

Here's the code to display the author's name:

<a href="<?php $Blog->disp( 'blogurl', 'raw' ) ?>?author=<?php the_author_ID() ?>" title="<?php echo T_('Browse all posts by this author') ?>"><?php $Item->Author->prefered_name() ?></a>

That will make the author's name a link, which makes the blog display only that author's posts. If you just want their name to be in plain text, then use this code:

<?php $Item->Author->prefered_name() ?>

To change the date format, change

$MainList->date_if_changed(); 

to

$MainList->date_if_changed( '' , '' , 'F-j-y' ); 

The code for the php date function is [url=http://us3.php.net/date]here[/url].

Now, if you want to modify the way it looks with CSS, then view source and see what tags the date_if_changed date is wrapped in. You can specify what tags are used like this:

$MainList->date_if_changed( '<h2>' , '</h2>' , 'F-j-y' ); 

h2 is the default, so you only need to put something there if you want to change it.

-Danny

3 Aug 06, 2005 23:06

Thank you. That was a tone of help.


Form is loading...