Home Forums Add-ons Flexible Content Field Fetch Feed

Fetch Feed

  • 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);
    <?php if ($maxitems == 0) echo '<li>No items.</li>';
    // Loop through each feed item and display each item as a hyperlink.
    foreach ( $rss_items as $item ) : ?>
    <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>
    <?php endforeach; ?>
  • 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)

The topic ‘Fetch Feed’ is closed to new replies.