• My home page and my blog have different themes so I have them using different wordpress installs. I want to have the titles of my most recent posts from my blog show up in the sidebar of my home page, but I can’t figure out how to reference it between installs. I think I basically need this:<?php $myposts = get_posts('numberposts=5&offset=0');
    foreach($myposts as $post) :?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Instead you may want to try this: Function_Reference/fetch_rss

    Thread Starter phanaks

    (@phanaks)

    awesome! Thank you! this is working perfectly with a little tweaking. How would I add the date of the posts as a non link after the title?

    Thread Starter phanaks

    (@phanaks)

    <div id="headlines"><?php include_once(ABSPATH . WPINC . '/rss.php');
    $rss = fetch_rss('https://www.hoistedsail.com/blog/wp-rss.php');
    $maxitems = 5;
    $items = array_slice($rss->items, 0, $maxitems); ?>
    <?php if (empty($items)) echo '<li>No items</li>';
    else foreach ( $items as $item ) : ?><a href='<?php echo $item['link']; ?>'title='<?php echo $item['title']; ?>'><?php echo $item['title']; ?></a> - <?php echo date("n/j/y"); ?><br />
    <?php endforeach; ?></div>

    The above calls todays date, but I cannot figure out how to have it echo the publish date of the article. I have been trying for days to figure this out…does anyone have any idea? Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multiple Installs Loop Problem’ is closed to new replies.