Right now I’m doing this (pseudo code)
posts = content_type("special_stuff");
$i = 0;
$n = 5;
$while(have_posts) {
if($i == $n) {
// print the content
}
++$i;
}
This is what I’m doing to always get the n
th item. I’m sure there is a better way, but I’m kind of a WP noob.
Related:
- (this question) How do I grab the nth element of a content type? eg. always getting the 1st or 5th most recent element from the db.
- List item
How do I do #1 based on content id?
First of all learn WP_Query class.
Answering on questions:
There are a few ways to do this, my first thought is to do: