O'Reilly logo

WordPress 2.8 Themes Cookbook by Lee Jordan, Nick Ohrn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a featured post slider

One of the most popular uses of JavaScript on a WordPress site is to create a content slider that shows particular types of posts or media. Some of the most popular sites use this effect, including eBay, Amazon, and ESPN.

Getting started

For this recipe, you need to have already created a theme, and decided where you'd like to put your featured content slider. In addition, you should have a special category that you assign to posts that you want to be featured.

How to do it...

First, you need to identify which set of posts will be part of your featured content slider. For the purposes of this recipe, we're going to assume that you assign all featured posts a category of Featured, which has a category ID of 3. Next, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required