• Resolved ollythebuilder

    (@ollythebuilder)


    Hi,

    I have several WP 2.5.1 blogs and want another one which will act as a homepage, linking to these third party blogs.

    My question is:-

    Is there a way that, when I write a blog post on a third party blog, automatically the latest post appears as alink on the homepage installation? Maybe some plugin, or php query to the third party databases, else using RSS?

    I’ve scoured the documentation and forum but remain confused. I am quite new to all of this and would appreciate a push in the right direction.

    Many thanks,

    Olly.

Viewing 6 replies - 1 through 6 (of 6 total)
  • If you don’t want to store posts on the “home page”, all you really need to do it to write a simple PHP script that would poll the RSS feeds from your third-party blogs and display links to posts. You don’t even need WordPress on your “home page”.

    If you do want to store posts on the “home page”, consider using the FeedWordPress plugin.

    Thread Starter ollythebuilder

    (@ollythebuilder)

    thank you NC@WP. I’m testing this plugin, but…

    surely the php script is the way to go. I am having a problem with this though!

    to recap, i have a few blogs, and want the last post from each to appear on a portal page. so for the portal page I have the following php…

    <div><h1>Blog 1</h1>
    <p><?php include_once ($_SERVER[‘DOCUMENT_ROOT’].’/blog1/latest_post.php’); ?></p></div>
    <div><h1>Blog 2</h1>
    <p><?php include_once ($_SERVER[‘DOCUMENT_ROOT’].’/blog2/latest_post.php’); ?></p></div>

    …and that calls latest_post.php, from each blog. latest_post.php contains…

    <?php $limit=1; $more=1; $count=1;
    if (empty($wp)) {require_once(‘wp-config.php’); wp(‘feed=rss’);}
    if ($posts) { foreach ($posts as $post) { start_wp(); ?>
    <h5><p class=”post-info”><?php the_time(‘l j F Y’) ?></p></h5>
    <h5>” rel=”bookmark” title=”Enlace permanente a <?php the_title(); ?>”><?php the_title(); ?></h5>
    <?php $count++; if ($count >1) { break; } } }?>

    * this says blog2, for the second blog.

    Here’s the problem!…

    On the output html, for <h1>Blog 1</h1> the first post is correctly called, but…
    On the output html, for <h1>Blog 2</h1> instead of calling the first post of blog 2, mysteriously, the SECOND post of BLOG 1 is called.

    i am a php newbie. can anyone help?

    Many thanks,

    Olly.

    Thread Starter ollythebuilder

    (@ollythebuilder)

    OOPS… PLEASE DISREGARD ABOVE POST AND READ THIS ONE! Olly.

    thank you NC@WP. I’m testing this plugin, but…

    surely the php script is the way to go. I am having a problem with this though!

    to recap, i have a few blogs, and want the last post from each to appear on a portal page. so for the portal page I have the following php…

    <div><h1>Blog 1</h1>
    <p><?php include_once ($_SERVER[‘DOCUMENT_ROOT’].’/blog1/latest_post.php’); ?></p></div>
    <div><h1>Blog 2</h1>
    <p><?php include_once ($_SERVER[‘DOCUMENT_ROOT’].’/blog2/latest_post.php’); ?></p></div>

    …and that calls latest_post.php, from each blog. latest_post.php contains…

    <?php $limit=1; $more=1; $count=1;
    if (empty($wp)) {require_once(‘wp-config.php’); wp(‘feed=rss’);}
    if ($posts) { foreach ($posts as $post) { start_wp(); ?>
    <h5><p class=”post-info”><?php the_time(‘l j F Y’) ?></p></h5>
    <h5>” rel=”bookmark” title=”Enlace permanente a <?php the_title(); ?>”><?php the_title(); ?></h5>
    <?php $count++; if ($count >1) { break; } } }?>

    **** this says blog2, for the second blog.

    Here’s the problem!…

    On the output html, for <h1>Blog 1</h1> the first post is correctly called, but…
    On the output html, for <h1>Blog 2</h1> instead of calling the first post of blog 2, mysteriously, the SECOND post of BLOG 1 is called.

    i am a php newbie. can anyone help?

    Many thanks,

    Olly.

    Thread Starter ollythebuilder

    (@ollythebuilder)

    Damn…. I can’t seem to post up the full code for latest_post.php.

    Thread Starter ollythebuilder

    (@ollythebuilder)

    the code for latest_post.php, that I was trying to paste above, should read as follows, except LINK HERE is really “a href” (I was pasting a link, doh!!) …

    <?php $limit=1; $more=1; $count=1;
    if (empty($wp)) {require_once(‘wp-config.php’); wp(‘feed=rss’);}
    if ($posts) { foreach ($posts as $post) { start_wp(); ?>
    <h5><p class=”post-info”><?php the_time(‘l j F Y’) ?></p></h5>
    <h5><LINK HERE=”/blog1 **** /<?php the_permalink() ?>” rel=”bookmark” title=”Enlace permanente a <?php the_title(); ?>”><?php the_title(); ?></h5>
    <?php $count++; if ($count >1) { break; } } }?>

    **** this says blog2, for the second blog.

    Does that make sense now? If anyone can shed any light on why this script is calling posts only from Blog 1, and not the first post from each blog, I’d be very grateful.

    Olly.

    Thread Starter ollythebuilder

    (@ollythebuilder)

    for those of you also wondering, one word…

    FeedWordPress.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘how to import third party WP posts into my blog ‘automatically’’ is closed to new replies.