1

There is one similar question, but I can't seem to get round to what's going on. So any help appreciated...

The following code works just fine on localhost, but when on the live site I get the following: WP HTTP Error: connect() timed out!

            <?php if (function_exists('fetch_feed')) { ?>
        <?php include_once(ABSPATH . WPINC . '/feed.php');
        $feed = fetch_feed('http://participmontpellier.wordpress.com/feed/');
        if ( ! is_wp_error( $feed ) ) : 
            $limit = $feed->get_item_quantity(2);
            $items = $feed->get_items(0,$limit);
        endif;
        if (!$items){
            echo $feed->get_error_message(); 

        } else {
            foreach ($items as $item) { ?>
                <h4><?php echo $item->get_date('F j, Y'); ?></h4>
                <p><?php echo $item->get_title(); ?></p>

            <?php }
        } ?>
     <?php } ?>

Thanks!

1
  • Your question is out the scope of this site. See the help center.
    – cybmeta
    Nov 18, 2014 at 12:09

1 Answer 1

1

At first check or set the timeout window on the online install, keyword max_execution_time.

Also a hint to the feed, there have a issue, often also a problem for the connection: http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fparticipmontpellier.wordpress.com%2Ffeed%2F

Also a chance is a plugin or function inside the Theme, that cut the connection.

The last point, that you should check this two constants. Ther should be on true value for connections.

  • WP_HTTP_BLOCK_EXTERNAL
  • WP_ACCESSIBLE_HOSTS

More background about WordPress and Offline Topic can you find in this source of the plugin. But you must check the contrary ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.