Doubt in wordpress blog

Discussion in 'WordPress' started by kks_krishna, Jun 30, 2007.

  1. #1
    HI,

    I had setup wordpress blog in my site. I want to show the recent 5 entries in my site home page. Can anyone help me by providing the scripts for doing that?
     
    kks_krishna, Jun 30, 2007 IP
  2. Analyst

    Analyst Well-Known Member

    Messages:
    623
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Analyst, Jun 30, 2007 IP
  3. cormac

    cormac Peon

    Messages:
    3,662
    Likes Received:
    222
    Best Answers:
    0
    Trophy Points:
    0
    #3
    cormac, Jun 30, 2007 IP
  4. veckd

    veckd Peon

    Messages:
    1,065
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I customized it myself using php.
    you can do it like this:
    <?php if (have_posts()) : ?>
            <?php $x=0; ?>
    		<?php while (have_posts() && $x != 5) : the_post(); ?>
                            <?php $x++; ?>
    Code (markup):
     
    veckd, Jun 30, 2007 IP
  5. sam79

    sam79 Peon

    Messages:
    97
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Without touching the code, you can also go to 'Options'-'Reading'-'Blog Pages' and enter '5' in 'Show at most: (box) posts'. It will limit the loop to 5 entries.

    If you only wish to show the 5 latest entries titles, you can also use the code : <ul><?php wp_get_archives('type=postbypost&limit=5'); ?></ul>.

    Hope this helps,
    Sam
     
    sam79, Jun 30, 2007 IP
  6. Etherfast

    Etherfast Peon

    Messages:
    1,192
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #6
    All of the solutions above are correct if he wants to display the latest X entries on his blog's sidebar for example. But by his description, he has a blog AND a website. He wants to display the last 5 posts on his site's index.

    Perhaps this needs clearing up,
     
    Etherfast, Jul 1, 2007 IP
  7. sam79

    sam79 Peon

    Messages:
    97
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If that's the case, he could do that by simply using the blog's RSS feed. I'm no php expert but I'm sure it can be done quite easily.
     
    sam79, Jul 1, 2007 IP
  8. sandyfeet

    sandyfeet Peon

    Messages:
    863
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
  9. CypherHackz

    CypherHackz Well-Known Member

    Messages:
    447
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    155
    #9
    hey you can use the widget from the themes admin page. or you can use my plugin, a customizable plugin here.

    -cypher.
     
    CypherHackz, Jul 2, 2007 IP