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 :-)

Related Posts

  1. Trick: Thesis Feature Box For A Dynamic Navigation Bar
  2. Remove all Borders & Get Free Skins for Thesis
  3. Customize When Your Sidebars Show What & Widgetize Your Thesis Multimedia Box
  4. Free HTML and CSS for a Table Within a Post or Page
  5. Tutorial: Customizing Thesis – Standard to Unique in 6 Easy Steps

{ 6 comments… read them below or add one }

1 Sad36 23 Oct 09 at 6:59 am

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

Reply

2 Somone Bull 23 Oct 09 at 9:44 pm

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

3 Hesham 24 Oct 09 at 7:49 am

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 My ComLuv Profile

Reply

4 Mike Tech Tips 25 Oct 09 at 3:06 pm

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 My ComLuv Profile

Reply

5 Jake | Web Journey 8 Feb 10 at 8:46 am

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

Reply

6 Somone Bull 8 Feb 10 at 4:19 pm

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

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv Enabled

Previous post:

Next post: