Repository navigation
Splitting a feed across two lists
Written against v1.4.5.4.
A news page often features the newest article as a card and lists the next few as headlines. Two shortcodes on the same page do it, the second skipping what the first showed with offset.
-
Add the featured item:
[uamswp_news site="https://news.example.org/" output="cards" count="1"] -
Below it, add the rest of the list, skipping the first item:
[uamswp_news site="https://news.example.org/" output="headlines" count="4" offset="1"] -
Preview the page. The card shows the newest article and the headlines show the four after it, with no repeat.
With offset set, the plugin requests count plus offset posts, then skips the first offset of them when it prints. So count="4" offset="1" requests five posts and shows four. Use the same filters on both shortcodes, or the second list skips posts the first one never showed.
Warning: always set count together with offset. With offset alone, the plugin requests offset posts and then skips all of them, so the list is empty (Troubleshooting).
Note: the JSON output (output="json" or no output) does not skip anything: it includes the offset posts.
Getting started | Guides | Reference | Troubleshooting | README | Repository
Written against v1.4.5.4. Edit these pages in docs/wiki/ through a pull request; edits made here are overwritten.
Getting started
Guides
Reference
Troubleshooting