Add the query parameter redirect_to to the URL of your blog. This parameter is mandatory.
Values can be:
- last or latest – The URL will redirect1 to the latest post.
- first or oldest – The URL will redirect to the first (oldest) post.
- prev or previous – The URL will redirect to the previous (by time) post of the same post type.
- next – The URL will redirect to the next (by time) post of the same post type.
- random – The URL will redirect to a random post.
- custom – The post will be determined according to the mandatory parameter orderby and the optional parameter order. Possible values for orderby are listed here. By default, order is “DESC” (descending – starting from the highest value, the later time or the bottom position in alphabetic order). Alternatively you can set it to “ASC” (ascending).
Obviously, the parameter “custom” lets you achieve the same as “latest”, “first” and “random”. These shortcuts exist just for convenience and readability.
The values “prev”/”previous” and “next” can be combined with “offset” in order to skip one or more posts.
Although “prev”/”previous” and “next” also let you flip through pages, they make most sense if applied while you’re viewing a post.
If you want to show the 2nd, 3rd, etc. matching post, you can use the parameter offset. The offset will be counted additionally. So “offset=1” means the 2nd post. If the offset is too high compared to the amount of matching posts, the procedure for “no posts found” will be run.
Use the parameter count together with random in order to pick a random post out of a subset. The value of count determines the N most recent posts or the N oldest posts (if N is prepended by a minus).
The parameter count can be combined with offset.
Use the parameter bias to pick a post from a subset (defined with count and – optionally – offset) with a higher probability than the rest. The value of bias is a percentage (without the % sign).
Redirect to the latest post:
Redirect to the 2nd-latest post:
Redirect to the post with the highest number of comments:
Redirect to a random post. Pick one from the latest 10 with a probability of 80% and from the rest with a probability of 20%:
(Note: Replace everywhere “www.example.com” with your blog’s URL.)
- Technically the URL is rewritten, i.e. the browser address bar will show the new URL. ↩