How to add featured posts in custom feature box in thesis wordpress theme
Thesis 1.6 wordpress theme has a lot of features in it.It is the only wordpress theme which is extremely seo friendly and also you hava a lot of customization options for thesis.Thesis 1.6 version has numerous options inbuilt in it which we otherwise needed to customise with coding.
Thesis 1.6 theme has both featured box and a multimedia box in it.Now lets find how to display posts inside the featured box of thesis.It is simple and follow the below steps to do it perfectly.
Featured box can be used for many purpose like displaying a custom message to users,welcome box and to also place ads in it.
STEPS TO ADD FEATURED POSTS IN FEATURED BOX:
1.You have to first enable the featured box option in the design options of the thesis wordpress theme.This can be found in the thesis options in your wordpress admin.
Now select if you want to display it in all pages or only home page and if you want it above or below content,or sidebars or inside the content.Now click the big ass save button.
2.Now you have to add the below code into the custom_function.php using ftp to add the featured article or post in the feature box.
/* To add featured post in feature box paste it in custom_function.php *****/
function featurecontent() { ?>
<div id="my-feature-box">
<?php $my_query = new WP_Query('category_name=featured&showposts=2'); while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID;?>
<div id="my-feature-box1">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<div>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Read the full article">Read the full article →</a>
</div>
</div>
<?php endwhile; ?>
</div>
<?php
}
add_action('thesis_hook_feature_box', 'featurecontent');
The category name is “featured” and number of post to show is 2.you can change it to your wish but adjust the width in #my-feature-box.If you want to display only one post change the width as 100%.
3.Now the code below is to make your feature box look pretty of to change the design.copy and paste it in custom.css file and save it
/* Featured Post Formatting */
.custom #feature_box { padding:0em; }
.custom #my-feature-box1 { width:46%; padding-left:1em; }
.custom #my-feature-box,#my-feature-box1 {float:left; font-family: Helvetica,Arial,sans-serif; color: #ffffff; background: #111; padding: 22px 15px 22px 15px; }
.custom #my-feature-box h2 { font-size: 2.2em; margin: 0 0 15px 0; }
.custom #my-feature-box h2 a,#my-feature-box a { color: #fff; text-decoration: none; }
.custom #my-feature-box h2 a:hover { color: #fb0; }
.custom #my-feature-box p {color:#fb0; font-size: 1.5em; line-height:1.5em; text-align: justify;}
.custom #my-feature-box .featurereadmore { padding: 22px 0 0 0; }
.custom #my-feature-box .featurereadmore a { font-size: 14px; text-decoration: none; }
4.Now the final step is to create a category “featured” in your wp dashboard.Assign it as the featured category.Then add some posts to the featured category you assigned.
Now you can see the featured posts in the featured box of your thesis wordpress theme.
Credits:Fourblogger.com
Related posts:
- Thesis-how to place ads Above the post title in thesis wordpress theme
- How to highlight author comments in thesis wordpress theme with background and logo
- Adding author profile box in thesis wordpress theme
- How to add clickable header banner in thesis wordpress theme
- How to add a widgetized 3 column footer in thesis wordpress theme
- How to add author profile box below posts in wordpress themes




6 Comments on "How to add featured posts in custom feature box in thesis wordpress theme"
nice post. thanks.
Very helpful post. I’ve looked at other tutorials for this procedure, but this one got it working for me. Thanks for the great info.
you are welcome! thanks for visiting!!
Excellent! Thanks for this. One question though…
I’m using the Featured Content Gallery on another site of mine (inside the Thesis Feature Box) and the photos are all flush left – very annoying! I want them centered in the Feature Box (or possibly even flush right on occasion). Any idea how I change that, and make it work?
Text is easy, these pix, another headache. Thanks in advance. Cheers!
Randy
This article was cool, but I wish there was an example of what the finished product looked like. Any help with that?
Thanks for the article. It got my feature box working.
I changed the css so its 100% so a single post appears at the top but I’d like to add an image to the top left of the feature box. Do you know how I could do this??