How to Customize Teaser box in Thesis Theme Homepage

by Suresh on January 3, 2010

In this tutorial I will show you two things one how to style you teaser box in home page  and second one is to add read more, add your comment link in home page teaser box. Normally thesis theme homepage is very simple. Which has content box, multimedia box feature box and sidebars. Inside content box we are having teaser box. By default thesis teaser having two posts adjacently like the below image.

default teaser

In order to look better we need to align posts one by one in homepage. And also set only six to eight posts in homepage like fourblogger homepage. Align one post in teaser full width ( ie your content box width) with read full article link in teaser menu. To achieve the above statement copy and paste the following code in custom.css file.

/* customize teaser box paste it in custom.css file  */

.custom .teaser_box{
width: 63.5em;  padding: 0; border-width: 0;
}
.custom .teaser{
width: 63.5em;  height:100%; margin-top:1em; margin-bottom:2em;

}
.custom .teaser .format_teaser {
font-size:1.4em;
}
.custom .teaser h2{
font-size: 2em;
text-align:left;
}

The above code I have changed my teaser-box and teaser width as same. You should replace with your content width. And if you want you can change your font size inside the teaser.

To place the above code in custom.css follow the below steps.

Choose ‘custom file editor’ under thesis options in left sidebar of the wordpress dashboard. Select custom.css file and click on edit selected file.

Paste the above code and save it. Check you site which having new look to your teaser box.

full width teaser box

thesis teaser box

How to add Read more and Add Comment links in Teaser

Here I am going to tell you how to add post and comment links in teaser menu(home page). In other words I will show you how to add number of comment links, add your comment link or add your opinion link and read full article link in home page teaser.

First we need to remove default full article and comments link. For this go to wordpress dash board.

Choose ‘design options’ under thesis options in left sidebar of the wordpress dashboard. Select ‘teasers’ section and inside this remove the mark from number of comments and read full article. Then click on big ass to save button.

Now copy and paste the following code in custom_function.php file. Use ftp to paste the below code or you can also use direct method.

/*This adds the menu links under the teaser posts, play around with the styling.*/

/* SAVE THIS IN CUSTOM_FUNCTIONS.PHP FILE */

function teaser_box_links() {
if (!is_single() && !is_page()){ ?>

<div id="teaserempty"></div>
<div id="teaserlinkscontainer">
<ul id="teasermenu">
<li><a href="<?php the_permalink(); ?>#comments" title="<?php comments_number(__('0 Comments','thesis'), __('1 Comment','thesis'), __('% Comments','thesis')); ?> on <?php the_title(); ?>" rel="nofollow"><?php comments_number(__('0 Comments','thesis'), __('1 Comment','thesis'), __('% Comments','thesis')); ?></a></li>
<li><a href="<?php the_permalink(); ?>#respond" title="Add your opinion on <?php the_title(); ?>" rel="nofollow">Add your Comment</a></li>
<li><a href="<?php the_permalink(); ?>" title="Continue Reading: <?php the_title(); ?>" rel="bookmark">Read More...</a></li>
<li><p></p></li>
</ul>
</div>
<?php } }

//teaser hook menu-links

add_action('thesis_hook_after_teaser','teaser_box_links');

For ftp The remote path is public_html/fourblogger.com/wp-content/themes/thesis_16/custom/custom_functons.php. Open this file and paste the above code. And save it.

The above code you can change your own name for the links instead of comments, add your comment and read more.

Now you have added the function for post link in teaser menu. We should style the teaser menu with font size and color. For this add the following code in custom .css file.

/* SAVE THIS IN CUSTOM.CSS FILE */
.custom .teaser {width: 100%; margin-top: 0.25em; padding-top: 0.25em; text-align: justify;}
.custom .teasers_box {padding-top: 0; padding-bottom:0; border-top: 0;}
.custom #teaserlinkscontainer {margin-top:0px;}
.custom #teasermenu {height: 30px;}
.custom #teasermenu , .teasermenu ul {padding: 0; margin: 0; list-style: none; line-height: 1; border-width: 0.5em 0.5em 0.5em 0.5em;}
.custom #teasermenu ul {float: left; list-style: none; margin: 0px 0px 0px 0px; padding: 0px;}
.custom #teasermenu li {float: left; list-style: none; margin: 0px; padding: 0px;}
.custom #teasermenu ul li {list-style: none; margin: 0px; padding: 0px;}
.custom #teasermenu a, .custom #teasermenu li ul {border-color: #111;}
.custom #teasermenu li a, .custom #teasermenu  li a:link {color: #1B32C4; background:none; display: block; font-weight: bold; margin: 16px; margin-top:9px; padding: 5px 5px 5px 5px; text-decoration: none;  font-size: 13px; font-family: Arial, Helvetica, sans-serif; -moz-border-radius-bottomleft:4px; -moz-border-radius-bottomright:4px; -moz-border-radius-topleft:4px; -moz-border-radius-topright:4px; -webkit-border-top-left-radius:4px; -webkit-border-top-right-radius:4px; -webkit-border-bottom-left-radius:4px; -webkit-border-bottom-right-radius:4px;}
.custom #teasermenu li a:hover, {color: #1B32C4; background: #7BAAD9; display: block; margin: 14px 8px 14px 14px; padding: 5px 5px 5px 5px; text-decoration: none; -moz-border-radius-bottomleft:4px; -moz-border-radius-bottomright:4px; -moz-border-radius-topleft:4px; -moz-border-radius-topright:4px; -webkit-border-top-left-radius:4px; -webkit-border-top-right-radius:4px; -webkit-border-bottom-left-radius:4px; -webkit-border-bottom-right-radius:4px;}
.custom #teaserempty {width: 100%; margin-top: 0.5em; margin-bottom: 0.5em;}
.custom #teasermenu li p,{color: #000000; background: #D0D0D0; display: block; width: 100%}

The above code you can change the link background color and other things. Then save it.

Now visit your site which having new looks in your home page.

teaser box with add comment link

Share your experience in comment section.

Related Tutorials:

  1. How to add Background Image in Teaser box at Homepage of Thesis Theme
  2. How to Change sidebar widget background and Border in Thesis Theme
  3. 11 Css Tricks for Thesis Theme Customization
  4. How to Customize Side Bar Heading Background colors and Fonts in Thesis Theme?
  5. How to add Tweet meme Button inside the Teaser and postbox of Thesis Theme

{ 40 comments… read them below or add one }

Jaydip Parikh January 5, 2010 at 10:55 AM

One more time gr8 post by you, Superb !! Keep sharing mate.

Reply

Pascal January 5, 2010 at 12:14 PM

Thanks for continuous reading and support.

Reply

aviationMY February 15, 2010 at 4:22 PM

Hi, Pascal.

i want a special request here? hehe…

How to add Read more and Add Comment links in Teaser

the above title i want it to change in post..how to do that?..im not using teaser, im using totally featured post..

so..if any of that can change the code?

i just want the read more, add a comment in post only..thats all..so its look rich..because the default post only no. of comments that float left.

Thanks in advance.

Reply

Suresh February 15, 2010 at 9:47 PM

Hai aviationMy,

To add readmore.. and add comment link in your homepage. follow the bellow instructions..
1. Go to thesis options->Display options->post. under this select ‘display post excepts’ in stead of display full post content.
2. follow the same instructions specified in this post to add ‘read more and add comment link in teaser. only replace the hook ‘thesis_hook_after_post’ instead of ‘thesis_hook_after_teaser’ in custom_functions.php. You will get the menu links in homepage..

Reply

aviationMY February 28, 2010 at 8:29 PM

Ok,
thank you for the respond..but if let say we make a featured post style in thesis theme and i want to use tag.

So, my question are:

1. how to to style the tag in Thesis theme? actually i just want to put some bg color and alil bit radisu with a nice hover effect…but i dont know what is the CSS name for that tag.

2. how to customize [click to continue…] in Thesis theme… maybe question 1 and 2 looks identical but the bottom is i want to stle the [click to continue…] or tag..

if i knew the CSS name…my blog will be nice when visitors see my read more link..

anyway thank you!

Reply

aviationMY February 28, 2010 at 8:31 PM

sorry…i mean the ** tag in question 1.

Reply

Suresh March 1, 2010 at 10:40 AM

hai aviationmy,

where you need your tags background and hover effect in homepage or single post page?. I will will give you the code according to that..
for your second question first add click to continue link by enabling teaser in homepage.. or go to thesis options ->display options-> posts and select display post excepts you will get click to continue link..then you can style it..

Reply

bharat January 16, 2010 at 1:51 PM

hi
i applied all the code , but still not able to see any difference on my site , nothing is coming up . i think i am missing something or some other settings are tempering with this one , can you please point out.

Reply

Vivek February 8, 2010 at 5:06 AM

i have applied the code and all the instructions given by you but in my site nothing is going to change. What problem i am facing i couldn’t figure it out can you help me out?

Reply

Pascal February 8, 2010 at 11:19 AM

i saw your site. it is working correctly. i dont know which one you are mention, tell me exactly. I think your are not enabled teaser in your homepage. it shows like post format..

Reply

Vivek February 8, 2010 at 9:06 PM

i have applied all the codes and enabled the teaser in homepage but it didn’t work correctly can you state me where i am facing problem.

Reply

Pascal February 8, 2010 at 10:09 PM

For that first you have to enable the teaser box in home page. To enable teaser box goto thesis option – choose home page display in that you have to set Number of featured posts to show “0″. then you will get the teaser.

Reply

Vivek February 9, 2010 at 4:32 AM

after putting “0″ homepage display will changes as you can see in the email that i have sent to u. it still remains a problem?

Reply

Suresh February 9, 2010 at 10:07 AM

Hai vivek,

I saw your screen shot and found some reasons for your problem, you are not enabled teaser in homepage.
check the following,
1. enable homepage display number of posts shown is ‘0′ in thesis options.
2. check have you marked ‘post excerpt’ at teaser display options in design options if not mark it.
3 check the post and thumbnail image settings select vertical position as ‘before post/page content’ in thesis options.
4. go to edit post you check post image and thumbnail image url. don’t give url in thumbnail image if you given url here you should use the exact image size in thumbnail. give your url in post image and set thumbnail size.post image has been adjusted to your thumb size. if you dont want this image inside the post enable the options in post image settings.

if you have problem contact via gtalk @admin@fourblogger.com.

Reply

Vivek February 9, 2010 at 11:53 AM

thanks for all the support. i am really thankful of you without you i am not able to customise the thesis. thanks again

Reply

Suresh February 9, 2010 at 12:00 PM

your welcome… vivek

Reply

Vivek February 9, 2010 at 3:23 PM

i still have problems with thumbnails. i am not able to show them on homepage. Can you point out where i am facing the problem

Reply

Suresh February 9, 2010 at 4:34 PM

I have checked your site it is working fine.. first upload image in media library then get the url from there.
then paste the url in post image .. it will shown in homepage..

Penny April 12, 2010 at 4:23 PM

I have a request…instead of changing the teaser from 2 boxes side by side to 1 box, I would like to have 3 boxes side by side. How do I tweak the codes? Thanks! :)

Reply

Suresh April 13, 2010 at 5:08 PM

hai penny,
If you need three column teaser box just reduce the width of the teaser. Normally In two column teaser if your content has width 56em means your teaser has 27 em half of the content. Now you change it in to one third of content with ie) teaser width 14em..in custom.css file.

Reply

Marcy from The Glamorous Life Association April 18, 2010 at 9:17 PM

Awesome post!
But my struggle is PHOTOS and THMBNAILS. Any way to increase the size of the thumbnail?
Anyway to have Thesis automatically pic up a photo from the post and make it a thumbnail (right now I have to put the http:// link of the image into the post. Which means I have to Post and then go see the address of the image and go back into post editor to add! Since I post 3 times a day…this is a HUGE drag.

Help. YOu are the genius to fix this!

Reply

Suresh April 18, 2010 at 9:35 PM

hai,

This tutorials contain the answer for you question watch the video..
http://fourblogger.com/how-to-add-thumbnail-image-inside-the-teaser-box-of-thesis-theme/

Reply

Amit kumar May 4, 2010 at 9:01 PM

please help me ,i tried the above code ..but after two posts it is coming ….not first and second ,I don’t know what’s happening…please help me out …..you can visit my site….

Reply

Suresh May 5, 2010 at 9:48 AM

hai amit,

go to thesis options in wp admin select homepage display here we need to set “number of feature posts to show” as zero.

I think now it was 2.

Reply

tutorial wordpress May 19, 2010 at 11:20 AM

I just wondering, how to add solid border each box? :(

Reply

Suresh May 19, 2010 at 1:28 PM

hai,
To add solid border in each teaser box.

add the below line in custom.css file
.custom .teaser {border: 2px solid #eee;}
the above code you can change the border width size and color code.

Reply

wilander May 23, 2010 at 10:41 PM

Suresh hi ,

i am new to this wordpress , i hav a doubt i have did every thing for displaying comment , add comment and readmore link to display on home page , but still not displaying ,

plz plz help me, should i wat to change the settings before pasting those codes,…if so wat settings plz guide me plz plz plz plz
thanks you

Reply

Suresh May 23, 2010 at 11:53 PM

hai wilander,
You homepage is not having teaser box..
First enable teaser in homepage then do customization..

To enable teaser
Go to thesis options in wp-admin..(site options in thesis1.7).
expand homepage display.

set ‘number of featured post to show in homepage’ as zero.
now teaser will enabled.

your customization will work..

Reply

wilander May 24, 2010 at 6:50 PM

hai Suresh,

alas! thank u so much its working, Really hearty thank full to u?
Keep rocking…

Reply

Suresh May 24, 2010 at 7:12 PM

hai wilander,

Get more video tutorials about thesis customization on our youtube channel

Reply

Joseph Condron May 25, 2010 at 5:23 AM

Hi Suresh,

Many thanks for posting a wonderfully helpful article. I have been implementing some of fourblogger’s advice on my site.

I have encountered two problems: I can’t get the social bookmarking icons to display properly in the header and I have inadvertently dragged down some of my posts. There are now some huge spaces on the homepage between the post excerpt and the add comment, read more tags. While other posts on the homepage are fine.

Would you mind taking a look? I have been racking my brains over it for quite some time now with no solution in sight!

Thanks for having such a wonderful and helpful site.

Regards Joseph.

Reply

Suresh May 25, 2010 at 12:04 PM

hai Joseph,

To reduce space between the teaser title and add comment links

In your custom_function.php file.
In before teaser code you have number of &nbsp remove all nbsp;

use the below code in custom.css file

.custom .teaser {margin-bottom:0em;}

Also there is no social icons code in header..

Reply

Gojeg May 25, 2010 at 1:29 PM

Hmm,,nice tutorial. I’ve just migrated to Thesis. It’s a great theme!

Reply

Gojeg June 3, 2010 at 3:28 PM

Nice tutorial, I’ve just migrated to Thesis. This is very useful. :D

Reply

wahid June 28, 2010 at 5:14 PM

Hello, I am having a problem.After using this code i have two post in every every teaser box.What have i done wrong?

Reply

Suresh June 29, 2010 at 4:20 AM

hai wahid,
I think now it is working fine…….

Reply

DAVID July 13, 2010 at 12:04 PM

I have just started using thesis. I was following your thesis customization ebook but i have a problem.My homepage shows 2 posts in full content while the others are just teasers. I want all the of them to be teasers. How do i do that?plz help.

Reply

Pascal July 20, 2010 at 11:02 PM

Have you fixed the issue? IF not and need my help, contact me via contact form. THanks

Reply

threza July 19, 2010 at 9:26 AM

hello…. i want to know how to add box type rectangle borders around the teaser….like in your home……..

Reply

Pascal July 20, 2010 at 10:54 PM

Hi Threza,

Thanks for enquiry. Contact via the contact form. I can fix this issue for $5. Thanks.

Reply

{ 1 trackback }

You are now listed on FAQPAL
January 3, 2010 at 10:37 AM

Leave a Comment

Page 1 of 0