0

is it possible to get a number of feed pages or the whole document?

For example I have a feed url like:

https://www.example.com/feed

and I can get the next page like:

https://www.example.com/feed?paged=2

but to be honest I do not know how many pages the feed contains.

I would like to iterate for the whole feed.

mskuratowski
  • 4,014
  • 15
  • 58
  • 109
  • Within WP or from the outside? – janh Nov 04 '17 at 19:03
  • @janh From outside. – mskuratowski Nov 04 '17 at 19:05
  • Basically, what you want is to iterate over all the pages/articles etc, of your wordpress instance. Don't understand why specifically from the feed. If this is what you need, I can write an answer with WP Query that can fit your needs, just confirm me. – yofisim Nov 04 '17 at 19:06
  • It is not only applied for the WordPress but the general. – mskuratowski Nov 04 '17 at 19:09
  • Feeds do allow pagination, but don't require it, see also [this question](https://stackoverflow.com/questions/1301392/pagination-in-feeds-like-atom-and-rss) for technical details. In your case: increase the parameter until you either get a 404 or no more ``s. Add a hard limit to not run endlessly with broken implementation (maybe compare item links?). – janh Nov 04 '17 at 19:16

0 Answers0