Support

Account

Home Forums Add-ons Flexible Content Field Fetch Feed

Fetch Feed

    • dodzki

    • July 9, 2013 at 11:40 am

    Hi,

    I have a problem with my feeds and I want to insert a field url from a flexible field with this line the_sub_field('np_sidebar_url'); within the fetch_feed('Insert Here');.

    <?php include_once(ABSPATH.WPINC.'/feed.php');
    
    									$rss = fetch_feed('');
    									$maxitems = $rss->get_item_quantity(5);
    									$rss_items = $rss->get_items(0, $maxitems);
    ?>
    <ul>
    
    <?php if ($maxitems == 0) echo '<li>No items.</li>';
    else
    // Loop through each feed item and display each item as a hyperlink.
    foreach ( $rss_items as $item ) : ?>
    <li>
    <a href='<?php echo $item->get_permalink(); ?>'
    title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
    <?php echo $item->get_title(); ?></a>
    </li>
    <?php endforeach; ?>
    </ul>
    • Elliot

    • July 10, 2013 at 3:00 pm

    Hi @dodzki

    I am unfamiliar with the fetch_feed function so I won’t be much help to you.

    I’m guessing there will be an action or filter that is run via WP on each post object in the feed. You could use this action to then run the ACF code and add in the extra data from the flexible content field.

    Good luck

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.