Is there a tutorial that will show me how to create a custom tabbed content area for my sidebar? I want to have two tabs - one for a specific category each (news & events) This tutorial http://net.tutsplus.com/tutorials/javascript-ajax/create-a-tabbed-interface-using-jquery/ shows how to create the tabs but how do I add the code for WordPress to show the excerpts of posts with thumbnail images from the categories so it shows in the selected tab?

link|improve this question
feedback

1 Answer

Follow that tutorial and use below code for specific category recent post where tutorial used un order list content.

<ul>
    <?php $recent = new WP_Query("cat=1&showposts=10"); while($recent->have_posts()) : $recent->the_post();?>
        <li><a href="<?php the_permalink() ?>" rel="bookmark">
        <?php the_title(); ?>
        </a></li>
    <?php endwhile; ?>
</ul>

Change cat id and number of post as per your choice.

link|improve this answer
Thanks pixelgrain. Will that show a thumbnail as well or do I have to do something else? – Kevin Rittershaus Nov 29 '11 at 11:43
to show post thumbnail you need to add post thumbnail snippet where you want to show. something like <?php echo get_the_post_thumbnail(); ?> and if you want to link that thumbnail to the post than use permalink like <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" ><?php echo get_the_post_thumbnail(); ?></a> – pixelngrain Nov 29 '11 at 13:00
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.