Title: a beginner&#039;s question &#8211; php does not work
Last modified: August 20, 2016

---

# a beginner's question – php does not work

 *  Resolved [Frank5189](https://wordpress.org/support/users/frank5189/)
 * (@frank5189)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/a-beginners-question-php-does-not-work/)
 * The purpose is to display RSS (e.g. BBC news) content on a wordpress page. I 
   have put the following code into the short code box and test it. It gave me a‘
   Error 500’
 * Maybe it is the path wrong.
 * Thank you for your help!
 * —————-
 * <?php
    include_once(ABSPATH.’wp-content/plugins/rss.php’); // path to include
   script $feed = fetch_rss(‘[http://feeds.bbci.co.uk/news/rss.xml&#8217](http://feeds.bbci.co.uk/news/rss.xml&#8217););//
   specify feed url $items = array_slice($feed->items, 0, 7); // specify first and
   last item ?>
 * <?php if (!empty($items)) : ?>
    <?php foreach ($items as $item) : ?>
 * </h2>
    <p><?php echo $item[‘description’]; ?></p>
 * <?php endforeach; ?>
    <?php endif; ?>
 * ———–
 * [http://wordpress.org/extend/plugins/shortcode-exec-php/](http://wordpress.org/extend/plugins/shortcode-exec-php/)

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

 *  Plugin Contributor [M66B](https://wordpress.org/support/users/m66b/)
 * (@m66b)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/a-beginners-question-php-does-not-work/#post-3264417)
 * Start with removing the PHP tags, see also the FAQ.
 *  Thread Starter [Frank5189](https://wordpress.org/support/users/frank5189/)
 * (@frank5189)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/a-beginners-question-php-does-not-work/#post-3264421)
 * 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&#8217](http://feeds.bbci.co.uk/news/rss.xml&#8217););//
   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](https://wordpress.org/support/users/m66b/)
 * (@m66b)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/a-beginners-question-php-does-not-work/#post-3264422)
 * 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.
 *  [whalleh](https://wordpress.org/support/users/whalleh/)
 * (@whalleh)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/a-beginners-question-php-does-not-work/#post-3264444)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/shortcode-exec-php.svg)
 * [Shortcode Exec PHP](https://wordpress.org/plugins/shortcode-exec-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortcode-exec-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortcode-exec-php/)
 * [Active Topics](https://wordpress.org/support/plugin/shortcode-exec-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortcode-exec-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortcode-exec-php/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 4 replies
 * 3 participants
 * Last reply from: [whalleh](https://wordpress.org/support/users/whalleh/)
 * Last activity: [13 years, 5 months ago](https://wordpress.org/support/topic/a-beginners-question-php-does-not-work/#post-3264444)
 * Status: resolved