Thesis Sidebar Teasers

What is it?
This plugin allows you to insert Thesis Teasers inside a sidebar. It doesn’t include all the options that you would normally expect. In a future release, it might.

Requirements:
This plugin for Wordpress requires that you’re using the Thesis theme (1.5 or higher.)

Download

Visit the plugin page on Wordpress.

CSS Styles

When you place the Thesis Teasers in your sidebars, it will inherit the same styles as your normal teasers. This means you have to override those styles with more specific styles. The most common style you’ll want to override is the width style so it fits into your sidebar. You can do it by adding the following code to your custom.css file:

#sidebars .teaser { width: 18em; }

Questions & Comments?
Leave a comment on this page and I’ll respond as soon as I can.

{ 2 trackbacks }

Adding Sidebar & Featured Posts Below A Post
November 19, 2009 at 9:11 am
4 Cool Plugins To Enhance Your Thesis-based Blog | Wordpress Jedi
January 26, 2010 at 7:38 am

{ 48 comments… read them below or add one }

Melvin Ram October 24, 2009 at 1:28 pm

Alright, I just added un updated version for Thesis 1.6. The updated version should probably work for Thesis 1.5 but I haven’t tested it yet. One shortcoming of the new version is that the image thumbnails are not linked to the posts. I’m working on a fix. If you know a way of fixing it, please email me at mr@melvinram.com.

Reply

Jeb October 31, 2009 at 3:23 pm

Hey there…thanks for this, I appreciate it very much. I’m wondering if there’s a way to control the width of the widget…it seems to be busting out of my widget column. I’m testing it at http://www.jebdickerson.com if you’d like to check it out.

Thanks much…Jeb

Reply

Melvin Ram October 31, 2009 at 3:27 pm

Jeb,

Glad you’re finding it useful. You can control the width of the teaser inside the sidebar by adding this to your custom.css file:

#sidebars .teasers { width: 18em; }

You can adjust the width (set to 18em in the above code) to whatever might suit you best.

~ mel

Reply

Jeb October 31, 2009 at 3:56 pm

Hi Mel,
Thanks for the quick response. I tried that, and changed the 18em to 10em and nothing happened. Any thoughts on what I’m doing wrong? The other widgets I’m testing/using seem to be fitting fine, but not this one for some reason…thanks again.

Reply

Melvin Ram October 31, 2009 at 4:57 pm

Are you sure you added it? I don’t see it here: http://jebdickerson.com/wp-content/themes/thesis_15/custom/custom.css

Reply

Jeb November 1, 2009 at 5:32 pm

Should be Thesis 1.6. Is it there?

Reply

Melvin Ram November 2, 2009 at 10:22 am

Okay, it looks like it’s there. Small typo. Instead of:

#sidebars .teasers { width: 18em; }

You need:

#sidebars .teaser { width: 18em; }

Reply

Melvin Ram November 2, 2009 at 10:27 am

Updated the page with info about the CSS.

Reply

Peter November 6, 2009 at 3:29 am

Hi! I was wondering if there is a way to use this widget in a page layout? Say I have a static page about a certain activity, and after the page content I want to show the 5 most recent blog posts from the category that is related to those activities… is that possible? Best regards, Peter

Reply

Melvin Ram November 6, 2009 at 9:43 am

Peter, if I understand you correctly, the answer is yes. What you’ll need to do is add use custom_functions.php to add a sidebar after the page/post. Then you can add the sidebar teasers just the same way as you normally would. Does that make sense?

Reply

AA-CHAN November 8, 2009 at 4:39 am

I don’t suppose there’s any way of removing everything but the thumbnail image using CSS? I can get rid of everything apart from the comments link and the ‘Read Full Article’ link.

Reply

Melvin Ram November 8, 2009 at 9:15 am

You can hide the “Read Full Article” link by adding this to your custom.css:

#sidebars .teaser_link { display: none; }

For the comments link, if you show me where you’re using it, I might be able to help.

Reply

AA-CHAN November 8, 2009 at 5:04 pm

The comments link is the one in a teaser that shows how many comments there are in the post.

Reply

Melvin Ram November 19, 2009 at 8:27 am

You can turn that off from the Thesis Design Options page. Look for the Teasers > Teaser Display Options section and turn off the ‘number of comments link’ and hit that Big Ass Save Button

Reply

Melvin Ram November 19, 2009 at 8:28 am

Just a heads up to everyone using the plugin, I was finally able to figure out how to add the plugin into the Wordpress plugin repository (http://wordpress.org/extend/plugins/thesis-sidebar-teasers/) so you should remove the plugin that you downloaded and install that one so that you can be notified when I update the plugin in the future.

Reply

Michael Aulia December 2, 2009 at 5:49 pm

Thank you so much for this Widget!! I came from the Arthemia Premium theme so I miss having these teasers on my blog. Great work!!

Reply

Shelby December 3, 2009 at 2:15 pm

Just installed and got this error message:

Warning: Missing argument 1 for thesis_teaser(), called in /home2/fastcuts/public_html/wp-content/plugins/thesis-sidebar-teasers/thesis_sidebar_teasers.php on line 78 and defined in /home2/fastcuts/public_html/wp-content/themes/thesis/lib/functions/teasers.php on line 40

Any ideas?

Reply

Melvin Ram December 3, 2009 at 2:26 pm

Hmm, did you install from the Wordpress page?

Reply

Hunter December 5, 2009 at 4:27 pm

I am having the same problem.

Reply

Melvin Ram December 5, 2009 at 6:22 pm

Hunter, what version of Thesis are you using? And are you installing the latest plugin from the Wordpress plugin directory?

Reply

Shelby December 7, 2009 at 7:48 am

Installed manually, now trying through Wordpress page.

Reply

Shelby December 7, 2009 at 7:51 am

Nope, still get the same error even after Wordpress install.

Reply

Melvin Ram December 7, 2009 at 11:29 am

Looks like Kalengi identified the issue that might be causing problems on some installations. You can see it at:

http://www.webdesigncompany.net/thesis-sidebar-teasers/comment-page-1/#comment-354

I’ll post a comment once the plugin has been updated with this fix.

Reply

Hunter December 5, 2009 at 7:01 pm

1.6 and yes i used the one from the Wordpress directory.

Reply

Melvin Ram December 5, 2009 at 7:08 pm

Hmm, I just created a brand new Wordpress website (2.8.7), uploaded Thesis 1.6 and installed the plugin from the wordpress plugin directory and it all worked: http://test.webdesigncompany.net

Can you provide me any other info / access that might help me help you?

Reply

Hunter December 5, 2009 at 7:13 pm

I’m using 2.8.6. Does it not work for that version? Cus its the most stable Wrodpress version right now.

Reply

Melvin Ram December 5, 2009 at 7:16 pm

It does. I was using it on a 2.8.6 installation before 2.8.7 came out.

Reply

Hunter December 5, 2009 at 7:21 pm

Warning: Missing argument 1 for thesis_teaser() in /nfs/c03/h04/mnt/57993/domains/layeredbyte.com/html/wp-content/themes/thesis_16/lib/functions/teasers.php on line 40

Thats the error message. The only other thing that I can give you is im using them in a separate sidebar below the content.

Reply

Melvin Ram December 5, 2009 at 7:29 pm

Let’s talk about this via gchat. I’ve sent you an invitation to chat. My gtalk username is mr@melvinram.com

Reply

Kalengi December 7, 2009 at 7:11 am

Hi Melvin,

I also have the same problem as Hunter. Did you ever get to the bottom of it?

Reply

Kalengi December 7, 2009 at 7:44 am

I located the surface problem. If you look at the definition of

thesis_teaser($classes, $post_count = false, $right = false)

in \wp-content\themes\thesis_16\lib\functions\teasers.php line 41, the argument $classes is overwritten with the value ‘teaser’. This means the it doesn’t matter what you pass to the function. It shall be overwritten anyway. It makes me wonder why in the first place the function is requiring that the $classes argument be supplied?? That’s a question for the Thesis team.

In this particular case, you can solve the problem by supplying a blank to the function. Go to the line 78 in \wp-content\plugins\thesis-sidebar-teasers\thesis_sidebar_teasers.php and replace:

thesis_teaser();

with

thesis_teaser(”);

That should silence PHP and allow the plugin to work as expected.

Remember I called this the ’surface problem’? This is because there must be a deeper reason why this bug is affecting some people and not others. Perhaps there are options that affect the way PHP treats such scenarios. Whatever the case, this fix should work fine.

Reply

Melvin Ram December 7, 2009 at 11:27 am

Thanks Kalengi. I will update the plugin with this.

Reply

Melvin Ram December 7, 2009 at 5:25 pm

I’ve updated the plugin to version 1.1.3 which contains Kalengi’s fix.

Reply

Kalengi December 7, 2009 at 10:29 pm

Thanks very much Melvin! I’ll update to the new version.

Reply

Melvin Ram December 7, 2009 at 11:40 pm

Let me know if that fixes it.

Reply

Kalengi December 9, 2009 at 2:12 pm

The fix worked perfect! This was a very timely plugin for me. Thanks for the good work :)

Reply

Michael Aulia December 10, 2009 at 7:43 pm

I don’t know why but I put 3 widgets (to extract 1 post from 3 different categories) but I found the CSS is a bit messed up somehow. (unless the mistake is in mine). It’s kinda hard to explain but the post excerpt on the first widget is following the
“li.thesis_sidebar_teasers h3″ CSS even though the post teaser is clearly not in h3, only the title of the category. and so on…

Reply

Kalengi December 22, 2009 at 7:48 am

Hi Melvin,

I’ve encountered a nasty side-effect of the plugin. It seems to be modifying the ‘global $post’ object while the page is still being rendered. I discovered this after spending hours trying to find out why my ‘thesis_hook_before_content_area’ and ‘thesis_hook_after_content_area’ hooks were not coordinating. On examining the post ids more closely, I discovered that the id at _before_content_area point was different from _after_content_area point, which shouldn’t be the case since I’m still on the same page. Tracking the second page_id revealed that it was the last post displayed by the sidebar teasers plugin.

I’ll try to find a work around since I’m on a tight schedule, but I’d have preferred if the plugin itself did not modify the ‘global $post’ object.

Reply

Melvin Ram December 22, 2009 at 9:38 am

Hmm… I’ll update this today. I think I know a simple solution.

Reply

Kalengi December 23, 2009 at 12:45 am

Thanks much! I’ll update as soon as you upload the fix.

Reply

Kalengi December 28, 2009 at 5:46 pm

Hi Melvin,

Thanks for the new update and sorry for not sounding appreciative earlier. I applied the update, but still had the same problem of the global post being altered. It turns out this isn’t your fault.

The nature of WordPress is that it expects only one post to be processed per full page. As a result, whenever you query new posts, the new query overwrites the main one. In addition, when you loop through the new query posts, the global post object is updated with each post.

I found a technique used by Lyza at http://bit.ly/7187t8 where the global objects are preserved while you retrieve and loop through a different set of posts. Applying this to your plugin, the body of sitespress_thesis_sidebar_teasers becomes:

global $wp_query;
global $post;

$main_query = clone $wp_query;
$main_post = clone $post;

$query_string = "category_name=" . $category . "&showposts=" . $posts;
$my_query = new WP_Query($query_string);
while ($my_query->have_posts()) : $my_query->the_post();
thesis_teaser('sidebar-teasers');
endwhile;

$wp_query = clone $main_query;
$post = clone $main_post;
setup_postdata($post);

Reply

Mitch January 3, 2010 at 5:15 pm

Nice job on the plugin..

Reply

Melvin Ram January 4, 2010 at 12:41 pm

Thanks Mitch!

Reply

marcelino January 22, 2010 at 1:21 pm

Everything is working properly, but, how do I make the font smaller. I believe I set the sidebar to 11px in the Options — I need to make smaller to match the other text

Reply

marcelino January 22, 2010 at 1:36 pm

Thanks for your help in the superb chat box :)

Your solution to the custom.css file worked fantastically;

#sidebars .teaser { width: 18em;}
#sidebars .format_teaser p { font-size: 10px; }

Reply

marcelino January 22, 2010 at 3:27 pm

maybe asking for a bit too much, but, is there anyway to exclude duplicate posts for the home page. (e.g, post in main content area do not appear in the side bar teaser area)

Reply

aboutyourbiz February 16, 2010 at 11:53 pm

How do I get the teasers in the sidebar to pick up after the full posts end, instead of duplicating the full posts? Example, if I have two full posts, how do I get the third post to show up as the first teaser rather than the first post?

Thanks

Reply

Melvin Ram February 17, 2010 at 8:16 am

@aboutyourbiz – that is currently not possible with the plugin.

Reply

Leave a Comment