Skipping posts from none-of-these[n] categories?
-
How can I skip posts whose main category has already been taken for some previous post in the loop?
The idea is to show only 1 post from each category, and skip the rest. It’s ok to match the first category assigned to the each post only.
E.g.
loaded = new array;
for (i=0 : post-loop-begins-here)
if (post.catID == loaded[try all instances]) {
loaded[i]=”post.catID”;
next post
} else {
the_content();
}
end forThat way you get a “first post for each category” loop without the complex code is usually proposed – like this
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Skipping posts from none-of-these[n] categories?’ is closed to new replies.