posts tagged ‘the loop’

Pagination for a Magazine Theme

February 20th, 2014

Say you have a magazine-style WordPress theme. It has a slider that loads three posts, and then a list of recent posts.  The issue of pagination come up when the user hits the Older Posts link.

Maybe you have a front page that displays 3 posts in the slider. The slider is a loop. Then a default loop that shows your most recent posts. And the number of posts is determined by the setting in your Settings – Reading – Blog pages show at most X posts.…

putting a loop in your sidebar

April 26th, 2013

The simplest way to put a loop in your sidebar is with Justin Tadlock’s sweet plugin Query Posts. This lets you use the query_posts function, with all of its options, in a widget.

However sometimes you might need a loop that does something unusual. I had a client who has a category of posts with natural history photos from near his home. He wanted an image to pop up, randomly selected, from the category.…