4 Nifty Code Snippets to Trick Out Your Thesis Theme

To make some really smooth changes with just a few snippets of code, copy and paste the following code snippets into your custom.css and/or custom_functions.php files.

1.  Remove the outlines around your links

before_with_outline

Add this code snippet to your custom.css file:

.custom a {outline: none;}

after_without_outline

2.  Remove the grey line below the navigation bar/menu

.custom #tabs {
 border-bottom: none;
 }

Click here to find out how to remove all grey lines.

3.  Automatically add post content using hooks

sidebar post contentWould you like to add some text and images somewhere in your Thesis Theme without hard coding it?

Use Thesis OpenHook plugin and insert a few lines of code where you want the content to appear.

Suggestion to place post content using Thesis OpenHook plugin:

  • Add post content to the top of your sidebar (like in my example image above)
  • Add post content to the bottom of a post – like subscriber information, social bookmarking icons or ads

Step 1:  Create the content

Create a post with the information you want to appear in the sidebar.

create post

In the category and tag options, create a new category (e.g. ‘info’) and give it a unique tag (e.g. ‘about’).

Step 2:  Copy and paste the code snippet into the custom hook box

<?php query_posts('category_name=info&tag=about&showposts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile;?>

In this example, I selected the before_sidebar_1 hook

  • before sidebar 1Remember to check the ‘Execute PHP on this hook’ box.
  • Hit your Little Ass Save Button and check your results.

You can reuse this code snippet and place extra tailor made pieces of information all over the place :-) Have fun with it.

4.  Add Style to Popular Posts in Your Sidebar

style background to popular postsIf you would like to style your sidebar content like I have with my ‘Popular Articles’, here is how to do it.

Grab Rob Marsh, SJ’s Popular Posts plugin and the companion plugin Post Plugin Library.Use the ‘Add New’ function on your Plugins page to search for ‘Popular Posts’ and look for Rob Marsh, SJ to know it is the right one.

You can also add/install his other plugins – Similar Posts, Recent Posts, Random Posts and Recent Comments - and style them in the same way – using different colours perhaps).

  • Just swap out the word ‘popular’ in the code below with ‘Similar’, ‘Recent’, etc.

Add the following code to your Custom.css file and replace the background and outline colour codes with ones that suit your site.

#popular-posts li {
 background: #EEEEEE;
 border: 1px solid #05396B;
 line-height: 1.4em;
 -moz-border-radius: 5px;
 padding: 1.2em;
 -webkit-border-radius: 5px;
}

If you have a darker sidebar, a lighter coloured background looks quite nice.

Let me know how you went :-)

{ 16 comments… read them below or add one }

Sad36 October 23, 2009

I think publication in journals and online goes a long way toward spreading your name and work around and garnering interest. ,

Reply

Somone Bull October 23, 2009

Absolutely. Also publishing a couple of short articles on eZine or other article directories gives you good incoming links and helps build you credibility. My only suggestion is publish quality stuff – your best – so you don’t get seen as just doing it for the links.

Reply

Hesham October 24, 2009

Thank you so much for the great Thesis tips, very useful as I am getting ready to publish a new blog!
.-= Hesham´s last blog ..I am Buying Thesis Membership so Post your Affiliate Link on this Post =-.

Reply

Mike Tech Tips October 25, 2009

Very useful code and tweaks. I particularly liked the Popular Posts modifications as I already use the Popular Post and Post Plugin Library. Thanks for sharing.
.-= Mike Tech Tips´s last blog ..Microsoft Windows 7 Release Insights =-.

Reply

Jake | Web Journey February 8, 2010

Works well except my header on the right side is dropped. Do you know how to fix this?

Reply

Somone Bull February 8, 2010

You’ll have to style your ad to go to the right more.

I can see the ad is floating over your header/logo. If you are using Thesis OpenHook to add the advertisement to your header, style it with html, something like this:

Give your image a div id of “header_advert”

Then, add some css like this – you’ll have to adjust the top padding and padding-left to get it to sit in the right place in your header area:

.custom #header_advert {float: right; position: absolute; width: 468px; height: 60px; top: 50px; padding-left: 460px;}

Reply

Angel June 26, 2010

I would like to turn my static site into a thesis theme can you do this for me? HEre’s the site http://www.vegasheroes.com/ Thanks.

Reply

Hazel July 17, 2010

I guess, Snippets are great specially if you know how to use and create them. But then, if you are not that too techie, you can just use other formats that automatically do the Snippets on our behalf. Thank you.

Reply

Jack September 30, 2010

Sweet tips, I use Thesis for my blogs as well!

Reply

shashank chinchli October 3, 2010

amazing tips !
thanks mam for the share!

Reply

Raj Hasan November 26, 2010

I am new thesis user. Thanks for great tips. I should use two of this tips on my blog :)

Reply

rohan @ Canonical URL January 27, 2011

can u tell me how to add random/popular posts with thumbnails in the sidebar without using a plugin?

Reply

Somone Bull January 30, 2011

Check out the wordpress codex site, this link should give you a good first page to look at: http://codex.wordpress.org/Customizing_Your_Sidebar You just have to copy and paste the code in a text widget.

Reply

Kindergarten Worksheets October 14, 2011

When I buy a product, my natural inclination is to read a manual or guide on how-to use the product purchased. Yes, the Thesis Theme comes with a 6-Step User’s Guide, SO READ IT!

Reply

Latina December 3, 2011

Great code to remove the outlines around your links, very useful, like it

Reply

Usman December 31, 2011

The last code snippet was useful for me. Although I had to change a few variables but now it’s working for my recent posts and featured articles widgets.

Reply

Leave a Comment

Previous post:

Next post: