Hello, I'm building a wordpress blog. I've installed a theme that has the featured post feature. The problem is whenever I post a new post it gets featured automatically, and I don't like that.. I want to take control of it, I mean I want to set up a post to be featured even if I post other posts later it will still be featured. featuredpost.php file <div id="block_featuredblog" class="block"> <img src="<?php bloginfo('template_directory'); ?>/images/ribbon_featuredblog.png" class="ribbon" alt="Featured Project"/><!-- CUSTOM FIELDS! --> <div class="block_inside"> <?php $featured = new WP_Query(); $featured->query('showposts=1&cat=-'.BLOG); // Category 1 is the Blog Posts, so we remove that while($featured->have_posts()) : $featured->the_post(); $wp_query->in_the_loop = true; // This line is added so that the_tags('') will work outside the regular loop. $featured_ID = $post->ID; // We'll store this here so that we know to skip this post in the main loop ?> <?php if (get_post_meta($post->ID, 'large_preview', true)) { ?> <div class="image_block"> <img src="<?php echo get_post_meta($post->ID, 'large_preview', true); ?>" alt="Featured Post" /> </div> <?php } ?> <div class="text_block"> <h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2> <small>in <?php the_category(', '); ?> tagged <?php the_tags(''); ?></small> <?php the_content('Read More'); ?> </div> <?php endwhile; ?> </div> </div> PHP: Regards,
$featured->query('showposts=1&cat=-'.BLOG); Code (markup): If you change that to: $featured->query('showposts=1&cat=X'); Code (markup): Change x to whatever the category number is for the category you want displayed there. That should work.
Already tried it before, but still the problem whenever I post a new post in that category it gets featured, instead I want the previous post (in the same catergory for example) to be featured.
The easiest way to accomplish this is to create a 'Featured Posts' category, then just reference that category. It will maintain and display the last post (in the featured post category) until you add a new one.