Network of blogs latest 5 posts rss, all listed on one page?

Discussion in 'PHP' started by johno123, Jan 12, 2009.

  1. #1
    Hi there,

    I have a request about a wordpress feature id like to add to one of my sites.


    I have alot of blogs that are related in content, and i would like to setup a page that displays the top 5 posts for all the sites.

    Ie.

    first site

    1
    2
    3
    4
    5

    Second site

    1
    2
    3
    4
    5

    Third site

    1
    2
    3
    4
    5



    I had a one line bit of code from somewhere a while back and it worked perfectly. But, of course cus i want it now i cant find it anywhere..


    So if anyone has any idea what i could use to achieve this feature. I would surely appreciate any help.



    thx alot for the help in advance
     
    johno123, Jan 12, 2009 IP
  2. artflutter

    artflutter Member

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    are all sites sharing the same database? if so it would relatively easy to query it, how are you ranking the posts?
     
    artflutter, Jan 13, 2009 IP
  3. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #3
    no each site has there own db

    i just want to pull the latest 5 posts from each site i choose.

    It was only a one line bit of code, i had. That would display rss feed of last 5 posts from as many sites i want.. But i lost the code somewhere..
     
    johno123, Jan 13, 2009 IP
  4. qualityfirst

    qualityfirst Peon

    Messages:
    147
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Create widgetized zones on your home page, and then insert a RSS widget with your settings in each zone.

    I can probably do this for you if you want.
     
    qualityfirst, Jan 13, 2009 IP
  5. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #5
    hi

    but i want it to show in a page i create. Not on the homepage.
     
    johno123, Jan 13, 2009 IP
  6. qualityfirst

    qualityfirst Peon

    Messages:
    147
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    0
    #6
    You can use the ExecPHP Wordpress plugin with MagpieRSS
     
    qualityfirst, Jan 13, 2009 IP
  7. johno123

    johno123 Well-Known Member

    Messages:
    1,492
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    130
    #7
    Im confused :confused:


    Not sure how to achieve this
     
    johno123, Jan 13, 2009 IP
  8. artflutter

    artflutter Member

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #8
    I use the plugin WP-O-Matic as my RSS aggregator. You can set it up to import the RSS feeds of your other sites and then automatically create a post and assign a category to them.

    If you want to display the 5 latest posts then you will need to put the following code somewhere on your site

    <ul>
    <?php $my_query = new WP_Query('showposts=5&category_name=Website2');
      while ($my_query->have_posts()) : $my_query->the_post();
       ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; ?>
    </ul>
    Code (markup):
    You just need to fill in the category name and repeat it 5 times for the 5 categories.

    If you don't want these posts appearing on your front page you can exclude them by modifying the loop and adding the parameter
    &category_name=-Website2,-Website4 etc.
    Code (markup):
    that should work
     
    artflutter, Jan 13, 2009 IP
  9. irunbackwards

    irunbackwards Peon

    Messages:
    791
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I'm pretty sure there are Wordpress plugins that do this already ...
     
    irunbackwards, Jan 13, 2009 IP