Title: danazz09's Replies | WordPress.org

---

# danazz09

  [  ](https://wordpress.org/support/users/danazz09/)

 *   [Profile](https://wordpress.org/support/users/danazz09/)
 *   [Topics Started](https://wordpress.org/support/users/danazz09/topics/)
 *   [Replies Created](https://wordpress.org/support/users/danazz09/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/danazz09/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/danazz09/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/danazz09/engagements/)
 *   [Favorites](https://wordpress.org/support/users/danazz09/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Fatal error: Call to undefined method WP_Error::get_item_quantity()](https://wordpress.org/support/topic/atal-error-call-to-undefined-method-wp_errorget_item_quantity/)
 *  Thread Starter [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/atal-error-call-to-undefined-method-wp_errorget_item_quantity/#post-1869607)
 * Resolved the issue with some help of a friend.
 * Needed to set the feed timeout parameter to be longer then 10seconds.
 * This is done in the feed.php file which is found in the wp-includes folder.
    `
   $feed->set_timeout(60);`
 * Should look like this:
 *     ```
       /**
       * Build SimplePie object based on RSS or Atom feed from URL.
       *
       * @since 2.8
       *
       * @param string $url URL to retrieve feed
       * @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success
       */
   
       function fetch_feed($url) {
          require_once (ABSPATH . WPINC . '/class-feed.php');
          $feed = new SimplePie();
          $feed->set_feed_url($url);
          $feed->set_cache_class('WP_Feed_Cache');
          $feed->set_file_class('WP_SimplePie_File');   $feed->set_cache_duration(apply_filters('wp_feed_cache_transient_lifetime', 43200, $url));
          do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
   
          $feed->set_timeout(60);
   
          $feed->init();
          $feed->handle_content_type();
          if ( $feed->error() )
              return new WP_Error('simplepie-error', $feed->error())
   
          return $feed;
       }
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [RSS Feed Too Slow – Timeout while fetching the feed.](https://wordpress.org/support/topic/rss-feed-too-slow-timeout-while-fetching-the-feed/)
 *  [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/rss-feed-too-slow-timeout-while-fetching-the-feed/#post-1798932)
 * Hi, I’m getting a similar issue, where I get WP HTTP Error: Operation timed out
   after 10001 milliseconds with 0 bytes received…..
 * If I refresh the page it then works. Just wondering what you asked your host 
   and what they did to fix the issue.
 * So is the issue on my servers side or is it from the yahoo pipes server side 
   where the information is being sent too slow?
 * My url is [http://www.dansportznet.com](http://www.dansportznet.com)
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Fatal error: Call to undefined method WP_Error::get_item_quantity()](https://wordpress.org/support/topic/atal-error-call-to-undefined-method-wp_errorget_item_quantity/)
 *  Thread Starter [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/atal-error-call-to-undefined-method-wp_errorget_item_quantity/#post-1869431)
 * I have since added:
 *     ```
       if (!is_wp_error( $afl_link ) ) {
   
       				$maxitems = $afl_link->get_item_quantity(20);
       				}else{
       					echo $afl_link->get_error_message();
       				}
       ```
   
 * under the line :
    `$afl_link = fetch_feed('http://pipes.yahoo.com/pipes/pipe.
   run?_id=8116da6bea0aacd7aceecaec5124dd1b&_render=rss');`
 * It seems that the issue is with a timeout. I am getting the following error message
   now.
 * WP HTTP Error: Operation timed out after 10001 milliseconds with 0 bytes received
 * This is doing my head in. Would appreciate any help if somebody has come across
   this before.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [fetch_feed(custom field url) printing out the url rather then using it](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/)
 *  Thread Starter [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/#post-1839349)
 * Thanks for your help. Works just as I wanted it to! 🙂
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [fetch_feed(custom field url) printing out the url rather then using it](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/)
 *  Thread Starter [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/#post-1839347)
 * Alchymyth thanks a lot. That has resolved my issue!
 * At the same time though, it has now brought up another one. While I can now use
   1 single php page as a template and grab the custom fields to dynamically change
   the parameters, I think I still need a separate php file for each page indicating
   what page to look for the information on. This is the code I mean:
 *     ```
       <?php
       				$page_id = 1384; //ID of page from your WP admin panel
       				$page_data = get_page( $page_id ); 
   
       				echo $page_data->post_content; // Show page content
       				$url = get_post_meta($page_id, 'address', true);
   
       	?>
       ```
   
 * I can’t just say `$page_id = get_page)($page_id);` can I, it will not know where
   to look for a particular page will it.
 * By the way I am new to WordPress and have just been learning off tutorials and
   forums.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [fetch_feed(custom field url) printing out the url rather then using it](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/)
 *  Thread Starter [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/#post-1839345)
 * Sorry, this is the first time I’ve ever posted on this forum. Did not know about
   the code thingy.
 * Here is what I have. The loop is actually closed. The loop is working fine when
   I put the actual URL in rather then using the custom field. It is just when I
   replace the actual URL with the custom field that it then just prints out the
   custom field url on the web page rather then showing the contents of that url.
 * Code again :
    `<?php
 * $page_id = 1391; //ID of page from your WP admin panel
    $page_data = get_page(
   $page_id ); echo $page_data->post_content; // Show page content
 * $url = get_custom_field_value(‘address’, true); //custom field
    ?>
 * <?php include_once(ABSPATH. WPINC. ‘/feed.php’);
 * $afl_link = fetch_feed($url); //making use of custom field rather then having
   fetch_feed(‘[http://feeds.feedburner.com/example&#8217](http://feeds.feedburner.com/example&#8217););
 * $maxitems = $afl_link->get_item_quantity(23);
    $afl_items = $afl_link->get_items(
   0,$maxitems);
 * if (!rss_items) {
    echo “There are no Feeds”; } else {
 * $i = 0;
    foreach ($afl_items as $item) { ?>
 * //Echo out the RSS feed details
    <p>get_permalink(); ?>” target=”_blank”> <?php
   echo $item->get_title(); ?><p>
 * ……… }
    …?>’
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [fetch_feed(custom field url) printing out the url rather then using it](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/)
 *  Thread Starter [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/#post-1839343)
 * Anybody got any idea about this?
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [fetch_feed(custom field url) printing out the url rather then using it](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/)
 *  Thread Starter [danazz09](https://wordpress.org/support/users/danazz09/)
 * (@danazz09)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/fetch_feedcustom-field-url-printing-out-the-url-rather-then-using-it/#post-1839158)
 * By the way, when I replace the $url custom field with an actual working url, 
   it works as expected, printing out the permalinks and titles of each feed.

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