boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Showing only the latest blog entry on my homepage index.php

 
Post new topic   Reply to topic    boardom Forum Index -> How to ?
View previous topic :: View next topic  
Author Message
nick91406



Joined: 04 Sep 2004
Posts: 2
Location: Van Nuys, CA

PostPosted: Sat Sep 04, 2004 11:23 am    Post subject: Showing only the latest blog entry on my homepage index.php Reply with quote

I have snipped enough code to figure out how to place a blog entry TITLE from my blog onto my index page in my root directory. Only problem is that it posts only the OLDEST entry and I want it to post the NEWEST entry.

Here's the snippet of code I'm using:
<?php the_title(); ?>

Is there some parameter I can modify this with so that it will snag the NEWEST blog entry?

I appreciate any help...and I'm a total PHP newbie...so be kind and be gentle. Very Happy

Nick
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
stevem



Joined: 15 Mar 2003
Posts: 241

PostPosted: Sat Sep 04, 2004 8:35 pm    Post subject: Re: Showing only the latest blog entry on my homepage index. Reply with quote

nick91406 wrote:
I have snipped enough code to figure out how to place a blog entry TITLE from my blog onto my index page in my root directory. Only problem is that it posts only the OLDEST entry and I want it to post the NEWEST entry.

<?php the_title(); ?> just gives the current title so how did you get just the oldest one? Perhaps you can show the code you've used, particularly any SELECT statement.

The code in http://cafelog.com/board/viewtopic.php?t=5753 seems to be doing something very similar ie finds the latest post
Back to top
View user's profile Send private message
nick91406



Joined: 04 Sep 2004
Posts: 2
Location: Van Nuys, CA

PostPosted: Sun Sep 05, 2004 10:38 am    Post subject: Reply with quote

Thanks for the reply...but it's greek to me. I have no clue. The code I have really just looks like a php tag at the beginning telling the rest of the page where the other functions live...then that snippet I included in my previous post. And it works. There has to be something simple like (ASC) or something that will sort the titles (which is only ONE) in ascending order...which would hopefully post the newest entry.

Grrrrrrrrrr
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
stevem



Joined: 15 Mar 2003
Posts: 241

PostPosted: Sun Sep 05, 2004 12:36 pm    Post subject: Reply with quote

You really need to give more detail since it's impossible to tell otherwise which SQL statement is being used. ASC may not be there as it may be the default, so you may need to add DESC.

If it's code that is used elsewhere then you may need to use a new SQL query, but without seeing what you are using I can't tell.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> How to ? All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group