Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter davve00

    (@davve00)

    Thanks!

    Thread Starter davve00

    (@davve00)

    yes, the rss, sorry. but is there no way I print only “17 may” and not the whole string???

    Thread Starter davve00

    (@davve00)

    ah, I got it to work with:

    <?php include('magpie/rss_fetch.inc');
    
    error_reporting(E_ERROR);
    
    $rss = fetch_rss('word/?feed=rss2');
    if ($rss) {
     $items = array_slice($rss->items, 0, 5);
     foreach ($items as $item )
     {   echo '<li><a href="'.$item['link'].'"><span class="date">'.$item['title'].'</a> - '.$item['author'].'</li>';  }
    }
    else
    {
      echo '<h2>Error:</h2><p>'.magpie_error().'</p>';
    }
    // Restore original error reporting value
    @ini_restore('error_reporting');
    ?>

    Thanks! Anyone have trouble using magpie try https://www.olate.co.uk/articles/view.php?id=214

    davve

    Thread Starter davve00

    (@davve00)

    hmm, seems a bit unnecessary, or am I wrong about how to use magpie? I place magpie in a folder on my server, then apply a script like this:

    <?php
    define('MAGPIE_DIR', '/magpie/');
    require_once(MAGPIE_DIR.'rss_fetch.inc');
    
    $rss = fetch_rss( 'https://www.yoursite.com/yourfolder/atom.xml' );
    
    //display latest blog content:
    $item = $rss->items[0];
    $content = $item['atom_content'];
    echo "<p>Latest Blog Entry:$content</p>\n";
    ?>

    But I dont have the atom.xml file? I guess i must edit WP to generate the atom.xml?

    im sorry if im a bit unclear.. it is on the same server, but not in the wordpress it self… I want to show recent posts on my index page and I have the wordpress in folder /word/ on the same server…

    davve

Viewing 4 replies - 1 through 4 (of 4 total)