Each post has an ID and I would like to know how they were assigned. Is there a pattern? Why are the ID's not being incremented by 1 every posts? It would be easier..My ID's go from 9867, to 9869, to 9864, etc.. I can't seem to find a pattern.

I could use "The Loop", but I'm doing that from another site. I want to include the last 30 posts of my wordpress site, so I need to find a pattern in the url to get the last 30 posts.

2 Answers 2


Each auto-draft gets its own ID, each revision, each nav item, page, custom post type …

The actual ID of a post should be irrelevant, this is really just needed for the database and ugly permalinks.

You cannot get the last 30 items by inspecting the post ID only.

Install a REST API on the other site and a rule to get the last x items.

  • Then how can I retrieve the last 30 items from an external domain?
    – user25893
    Apr 10, 2013 at 15:22
  • @Maxwell See my update.
    – fuxia
    Apr 10, 2013 at 15:24
  • Thank you. It looks like a very complicated solution though.
    – user25893
    Apr 10, 2013 at 15:25
  • 1
    If you take my code it is done in less than 20 minutes. Really not that complicated. :)
    – fuxia
    Apr 10, 2013 at 15:26
  • 20 mins for you, @toscho :)
    – vancoder
    Apr 10, 2013 at 16:56

Use the RSS feed - typically at http:/sitename/feed.

You can set the number of items the fed contains by changing the value Syndication feeds show the most recent in Settings > Reading

  • This is a very vague 'answer'.
    – vancoder
    Apr 10, 2013 at 16:55
  • 1
    @vancoder Feel free to improve it or leave your own answer :)
    – anu
    Apr 10, 2013 at 16:57
  • I only leave answers when I have one to leave :)
    – vancoder
    Apr 10, 2013 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.