View previous topic :: View next topic |
Author |
Message |
nick91406
Joined: 04 Sep 2004 Posts: 2 Location: Van Nuys, CA
|
Posted: Sat Sep 04, 2004 11:23 am Post subject: Showing only the latest blog entry on my homepage index.php |
|
|
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.
Nick |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 241
|
Posted: Sat Sep 04, 2004 8:35 pm Post subject: Re: Showing only the latest blog entry on my homepage index. |
|
|
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 |
|
 |
nick91406
Joined: 04 Sep 2004 Posts: 2 Location: Van Nuys, CA
|
Posted: Sun Sep 05, 2004 10:38 am Post subject: |
|
|
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 |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 241
|
Posted: Sun Sep 05, 2004 12:36 pm Post subject: |
|
|
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 |
|
 |
|