WordPress.org

Forums

Lastest Posts List (15 posts)

  1. lordy16
    Member
    Posted 9 years ago #

    On the front page of my website (http://www.teaspoondiner.net/) i have a lastest blog posts list. at the moment i edit this page manually each time i publish a new blog post. what i would like for this to do is to update it automatically when i add a new post so as i dont have to edit it manually. im assuming this would be dont with a PHP script, ive done some basic php scripts but i have no idea how to do something like that. Could someone help me?

  2. NuclearMoose
    Member
    Posted 9 years ago #

    What about using a plugin like Mt. Dew Virus' Latest Posts?
    http://mtdewvirus.com/code/wordpress-plugins/

  3. lordy16
    Member
    Posted 9 years ago #

    thanks, but i didnt really want to use a plugin :(

  4. Joshua Sigar
    Member
    Posted 9 years ago #

    You could use the following template tag
    http://codex.wordpress.org/Template_Tags/wp_get_archives

    and set the type to postbypost

  5. NuclearMoose
    Member
    Posted 9 years ago #

    Well, using a plugin is much easier than hand-coding changes to a page every time, and not only that, many themes come pre-configured to take advantage of plugins.

    It's user preference, of course, but plugins are sweet! :^)

  6. lordy16
    Member
    Posted 9 years ago #

    except that its not a page that is actually within worpdress? its a seperate page... how do i do that with a plugin?

  7. Mark (podz)
    Support Maven
    Posted 9 years ago #

    The page needs to be a .php page.
    At the top of that page, you need to include 'wp-blog-header.php'

    <?php
    include ('path/to/wp-blog-header.php');
    ?>

    and doing that means you can then use wp functions or plugin functions on that page.

  8. lordy16
    Member
    Posted 9 years ago #

    aaah yayz :) thank you so much for that :)

  9. lordy16
    Member
    Posted 9 years ago #

    well it worked for a little while, but then it started loading a blank page whenever someone tried to access the index.php page on my website. once i removed the
    <?php
    include ('path/to/wp-blog-header.php');
    ?>
    and started editing the page manually again the page loaded for everyeone so im not too sure whats going on there

  10. lordy16
    Member
    Posted 9 years ago #

    I've tried many different ways of including that file in the page and none of them have worked, it just loads a blank page, so im not too sure how i can use a pluginon an external page, if its at all possible.

  11. vkaryl
    Member
    Posted 9 years ago #

    When things stop working after they've BEEN working, if you haven't made any changes prior to the halt, then it could be your host has done something.

    Did you contact your host to find out if they "upgraded" something like PHP, mySQL, apache? (assuming of course that you're hosted on a unix-type server....)

  12. Michael Bishop

    Posted 9 years ago #

    If you want some simple WP code to list recent posts, you can use this, but you'll still need to use the include Podz showed you
    <h3><?php _e('Recent Posts'); ?></h3>
    <ul>
    <?php
    $posts = get_posts('numberposts=5');
    foreach($posts as $post) :
    setup_postdata($post);
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>

  13. lordy16
    Member
    Posted 9 years ago #

    no i figured out that it didnt work to begin with, so i cant do the include thing, what im wondering is if theres another way to do it, but if theres not then :( cos thers a few plugins i wouldnt mind using

  14. lordy16
    Member
    Posted 9 years ago #

    my other friend rtied it and it didnt work for him either, so im not too sure whats goin on there

  15. lordy16
    Member
    Posted 9 years ago #

    This is really frustrating me because i just found out one of my friends managed to do it just fine.
    THere are a number of plugins i would like to use if i can get it to wokr, but its still just loading a blank page if i include OR require the wp-blog-header.php page into the page i want it to go into.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags