various possibilities:
a – you could use a category or tag ‘featured’ for the post; and add the css class .featured
depending on that;
b – you could use a custom field to mark ‘featured’ posts; and use that to add the css class .featured
.
what is the current code for the post div?
example for a (assuming the post has the category ‘featured’, and a fairly standard post div with post_class()
):
<div id="post-<?php the_ID(); ?>" <?php post_class(array('box',(in_category('featured')?'featured':''))); ?>>
<!--whatever post outputs-->
</div>
A refined explanation can be found here:
How to Style Each WordPress Post Differently
my solution:
enable your custom field and put a key: class and value: featured
on your post that you want to feature.
in your index.php wherever you put your blog listing, do this:
in your div class, put this:
<div class=”<?php $value = get_post_custom_values(“class”); if ( is_array($value) ) echo “featured”; else ?> <?php echo ”; ?>”>
finally, style your .featured
.featured
{
width:500px;
}
I think I am asking the same thing, but can you let me know if I am (sorry – it’s been a long day and I’m not particularly tech, but I’m trying):
I wonder if anyone has any idea how to vary the content width of a post?
This post, for example, has a long body of text that I would like to make into columns that are the same height as the images (so people don’t have to scroll vertically as well as horizontally).
http://www.gemmarose.com.au/tanja
If I make the standard post wider then the other posts with less content are really far away from the images (see here for a post with less content):
http://www.gemmarose.com.au/red-centre
Is there a way that I can make the content area dependant on the amount of content – I feel fairly comfortable creating columns, just not varying the content width to suit.
Otherwise is is possible that I set up different post templates with various widths – so for example if I wanted a four column post I could choose a different template and make the columns myself?
Thanks,
Gemma
@gemmarose
please start your own topic, as you question is not exactly the same as the current topic.