WordPress.org

Ready to get started?Download WordPress

Forums

Display only newest post (11 posts)

  1. davidcorrell
    Member
    Posted 9 years ago #

    Hi... I've done some searching here, and haven't yet found an answer to my question.

    A friend showed me how to display individual categories in a page other than the WP index, by putting the category number at the top of your document.

    I am now trying to figure out how to display only the newest post on a page other than the WP index. Just the newest post, whatever it is.

    How is this done?

    thanks!

  2. adeydas
    Member
    Posted 9 years ago #

    WP shows the newest posts by default. You can change the number of new posts to be shown from Options>Reading.

    Suppose you want to show the new posts in a page called new.php, then copy everything you have in index.php and put it in new.php and it should work if you have the 'messy' URL's. In case of the clean URL's, you have to edit your .htaccess.

  3. Kafkaesqui

    Posted 9 years ago #

    Take a look at the WP function get_posts():

    http://wiki.wordpress.org/get_posts

  4. jazzy
    Member
    Posted 9 years ago #

    I think I have the same problem... my first blog entry shows and my second blog entry kind of shows a little bit of itself but it goes over the top of my previous one which still displays.. this wp stuff is a rigmarole to configure.

  5. Kafkaesqui

    Posted 9 years ago #

    Actually jazzy, the issue here is one of how to accomplish a specific task (display only the most recent post on a page), and is not (necessarily) a problem.

  6. jazzy
    Member
    Posted 9 years ago #

    Still very technical to configure.. the smallest thing makes the biggest difference...

  7. Kafkaesqui

    Posted 9 years ago #

    When you want to force a program to do what you want instead of what it normally does, it tends to lean that way, even for the little things... :)

  8. jazzy
    Member
    Posted 9 years ago #

    Hehe. :p

    Mine is still toppling over the other one. Is it my div layer doing that?.

  9. jazzy
    Member
    Posted 9 years ago #

    Better yet, http://dont-complain.org/jazzy is my site, the way that blog is on it is the way I would like my wp one... my wp is http://www.dont-complain.org/jazzy/wp/index.php you can see how I have it kind of like it, but its not working, (errors in code, etc) so can someone write me a main template code so that it looks like that?. Same width, font color, font style, same hover link color, etc and put it on here for me to paste into my main template... because I am stuck like nothing else. I'll give credit to whoever can do it.

  10. jazzy
    Member
    Posted 9 years ago #

    LOL, anyone gonna help?.

  11. davidcorrell
    Member
    Posted 9 years ago #

    well, I answered my own question. After fighting with the get_recent_posts plug-in for a long time, I discovered get_posts which did exactaly what I wanted.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.