Loop API & functions
Four global functions. That's the whole public PHP surface.
freshet_feeds( string $feed_slug ): ItemCollection
The loop API. Returns the feed's cached items as an iterable, countable collection of Item objects — never blocks on the remote API (stale items are served and a background refresh queued; see Caching). Unknown slug → empty collection, never an error.
$items = freshet_feeds( 'linkedin-main' );
if ( ! $items->isEmpty() ) {
foreach ( $items->take( 3 ) as $item ) {
// render
}
}
ItemCollection implements IteratorAggregate and Countable, plus take( $n ), isEmpty(), and all().
freshet_feeds_render( string $feed_slug, array $args = [] ): void
Full template-chain render: feed.php → layout-{layout}.php → item hierarchy. What the block uses internally, available to any theme.
freshet_feeds_render( 'yt-tutorials', [
'layout' => 'carousel', // resolves layout-carousel.php through the chain
'count' => 6, // overrides the feed's item count
] );
An empty (or never-fetched) feed renders empty.php — which shows error details only to users with manage_options and nothing to visitors.
freshet_feeds_item( Item $item, Feed $feed ): void
Renders one item through the item hierarchy (item-{feed-slug} → item-{provider} → item). Layouts call it per item; use it in custom layouts or anywhere you have an Item in hand.
freshet_feeds_template( string $name, array $vars = [] ): void
get_template_part() for Freshet Feeds templates: resolves $name.php through child theme → parent theme → plugin and extracts $vars into scope. For composing partials inside your overrides:
// inside {theme}/freshet-feeds/item.php
freshet_feeds_template( 'item-footer', [ 'item' => $item ] );
// looks for {theme}/freshet-feeds/item-footer.php
WP-CLI
wp freshet-feeds status # all feeds + cache age + last error
wp freshet-feeds fetch <slug> [--force] # run the full fetch pipeline now
fetch --force bypasses the fetch lock — the smoke test for provider config, credentials, and templates in one command.