![]() |
Adding More Interactivity To Your Website By
Michael Gray
If you've spent any time visiting blogs lately chances are you've seen those small little photo's accompained by a title or bit of text in or near the masthead. I'm not sure if it has a proper name, but most people I've talked to call it a carousel, in this tutorial I'm going to show you how to add one to your blog. For the few of you who don't know what I'm talking about, here's a screen shot from gawker.com which is the first place I saw it being used. ![]()
As time goes on the stories move across the banner, eventually dropping out of view, similar to the way horses do on a carousel. I'm going to be showing you how to do this with Thesis, as with many of these tutorials you can adapt the programming to work with any blog, it's just easier with thesis. First we're going to need a way to isolate which posts we want to appear in the top. Chances are you are going to want to pick the best of your newest posts (not all new posts are best). I like to keep my blog low maintenance or self maintaing, so I decided to use the featured category which is the same I use to fill the visual slider that's on the homepage. However you could just as easily use tags instead of an isolated category. To make the carouse happen we're going to create a custom function in custom_functions.php called top_carousel() and inside of it we're going to add global $post (which allows wordpress to get items outside of the current post) and an "if" statement to make the carouse appear only on single post pages (I felt the homepage looked to "busy" with a slider and a carousel, but that's your choice). Here's what the initial code looks like: Continue reading this article.
|
||||||||
|
|
|
-- DevWebProAU is an iEntry, Inc. publication -- iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 2009 iEntry, Inc. All Rights Reserved Privacy Policy Legal
|