python-wordpress-xmlrpc
python-wordpress-xmlrpc copied to clipboard
How would I retrieve all posts?
How would I get all posts, without having to check how many there are to begin with manually. I tried looking and searching the docs, with no luck.
items = wp.call(GetPosts({'orderby': 'post_modified', 'number': 161}))
The number filter is optional, should return all posts if not provided no?
items = wp.call(GetPosts({'orderby': 'post_modified'}))
No, by default it seems to return about 10 when I leave that out.
You must pass an offset to iterate over all of them. Wordpress itself will not give you all on one request:
https://www.shift8web.ca/blog/use-python-connect-wordpress-site/