• carlym99

    (@carlym99)


    I implemented the following feed to pull in posts from a tumblr blog and it was working for a while, but now it seems to have broken my homepage and I’m not sure why.

    Could it be one of the other WP related files? Would you be able to take a look? I’m actually helping a friend redo their site for his band and am setting a up a tumblr blog for them for easier blogging capabilities while on the road.

    Is there a way to troubleshoot which WP file is throwing the issue?
    OR are there any other recommendations for scripts to feed in posts from tumblr?

    Code I have added to my template – https://beta.onefewthings.com/ (login is: Darling2013!)

    <div id="tumblr-feed">
    	<?php require_once (ABSPATH . WPINC . '/feed.php');
    	$rss = @fetch_feed('https://DOMAIN.tumblr.com/rss');
    
    	if (!is_wp_error( $rss ) ) :
    		$maxitems = $rss->get_item_quantity(9);
    		$rss_items = $rss->get_items(0, $maxitems);
    	endif;
    
    	if ($maxitems == 0) echo '<div class="tumblr-post">Nothing to see here, folks.  Go to <a href="https://DOMAIN.com">DOMAIN.com for the fun stuff.</div>';
    	else
    	foreach ( $rss_items as $item ) : ?>
    		<div class="tumblr-post">
           <p><?php echo ''.$item->get_date('F j Y'); ?></p>
            <p><?php echo esc_html( $item->get_title() ); ?></a></p>
    			<p><?php echo string_limit_words($item->get_description(), 40); ?>
    		<a>get_link()); ?>'> read more...</a></p>
    		</div>
    	<?php endforeach; ?>
    
    </div>
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Do you have WP_DEBUG set to true? It will give you error messages which should be a clue to where to start looking, though the location given is where PHP gave up trying, not necessarily where the error actually is. Also remove the @ (suppress errors) for fetch_feed() to see if the problem is a connection error.

    If I were to guess, I’d say it was some change in the SimplePie object used to manage the feed data, or the fetch_feed() function itself. The object class is defined in wp-includes/class-simplepie.php.

Viewing 1 replies (of 1 total)
  • The topic ‘Tumblr Feed’ is closed to new replies.