![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi All,
Having fun working with the Lifestyle theme, very nice. Currently the home page featured boxes on the home page query the database for the latest posts in a particlular category. This can be modified in the Lifestyle admin. I'd like a box to look just like that, including the 70px thumbnails etc. but I'd like it to display the last 5 posts period, no filtering by category. Currently the code to display the posts by category look like so; Code:
<div class="hpfeatured">
<?php $feature_cat_1 = get_option('lifestyle_feature_cat_1'); $feature_cat_1_num = get_option('lifestyle_feature_cat_1_num'); if(!$feature_cat_1) $feature_cat_1 = 1; //setting a default ?>
<?php $recent = new WP_Query("cat=".$feature_cat_1."&showposts=".$feature_cat_1_num); while($recent->have_posts()) : $recent->the_post();?>
<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
[img]<?php echo get_post_meta($post->ID, [/img]" alt="<?php the_title(); ?>" />
<?php else: ?>
<?php endif; ?>
<?php the_title(); ?>
<?php the_content_limit(80, ""); ?>
<div style="border-bottom:1px dotted #94B1DF; margin-bottom:10px; padding:0px 0px 10px 0px; clear:both;"></div>
<?php endwhile; ?>
</div>
Thanks. David |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Image Query | CeeGee | General Discussion | 4 | 08-31-2010 09:01 PM |
| Need a little help in forming a query .. | chadenicely | General Discussion | 10 | 06-06-2010 03:29 PM |
| Footer Query | jonhill | General Discussion | 3 | 12-21-2009 03:12 PM |
| FCG query | wgrant | General Discussion | 6 | 06-02-2009 06:48 PM |
| 'Currently browsing' query | blagdonred | General Discussion | 15 | 01-05-2009 06:14 PM |
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us