Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor M66B

    (@m66b)

    Start with removing the PHP tags, see also the FAQ.

    Thread Starter Frank5189

    (@frank5189)

    thank you for such speedy reply.

    Here is the code without the php tags: it still gives me the same error.

    More help please, thank you.


    include_once(ABSPATH.’wp-content/plugins/rss.php’); // path to include script
    $feed = fetch_rss(‘http://feeds.bbci.co.uk/news/rss.xml’); // specify feed url
    $items = array_slice($feed->items, 0, 7); // specify first and last item

    if (!empty($items)) :
    foreach ($items as $item) :

    <h2>
    echo $item[‘title’];
    </h2>
    <p> echo $item[‘description’]; </p>

    endforeach;
    endif;

    Plugin Contributor M66B

    (@m66b)

    Sorry, but this won’t work. I can only help you if you somewhat understand what you’re doing (no offence meant). Simply removing the PHP tags leaves a mix of PHP and HTML.

    Hello, I already tested the php code but I don’t know how to insert it into my page. Pls help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘a beginner's question – php does not work’ is closed to new replies.