How to make the Thesis theme more Bing-friendly

You may think that Bing, Microsoft’s new search engine, is a complete waste of time given Google’s 90%+ market share. But Bing is different. Unlike Google or Yahoo, it aggregates content. Ian Lurie, who writes about SEO/online marketing at Conversation Marketing, puts it this way:

Microsoft’s Bing is the latest example of search engines as aggregators, rather than indexes. Go to Bing.com, search for ‘LA Lakers’, and you get a list of results. Roll over a search result, though, and you get a detailed look at the content on the listed site.

What this means is that you’re giving the person searching for results yet another reason NOT to click through to your blog/website. Why? Well now they can read the meta description the search engine serves up for your site AND an excerpt of the first 300+ characters of content on your page.

For a blog that displays latest posts on the home page, this may not be ideal (because people may not hire you based on your latest ‘I hate clients’ blog post).

This is the problem I’ve been having with Bing (displaying the wrong content, not hating my clients), so I decided to tweak my WordPress theme, Thesis.

Here’s what I want to have displayed at the top of my home page for prospective clients, blog readers and search engines to see:

introbox

Pretty simple, right? Yes, very. Thesis uses hooks to inject code into the theme, so you have to write a custom function to make anything happen. Here’s a walkthrough to help you out:

Step 1 – Feature Box settings

I suspect Chris Pearson has big ideas for Thesis’ Feature Box in the future, but so far it’s just a little container that you have a bit of styling/placement control over. You could create a new hook with a div element, but the feature box is actually perfect for the purpose of adding a basic introductory paragraph.

In your WordPress admin panel, click on Appearance in the left navigation bar, then click on Design Options button. Under the heading ‘Features box’ in the Thesis design options page, expand the ‘Placement’ tab, and change its settings to ‘in your content column’ and select the ‘on the home page only’ radio button. Then set the ‘display feature box after post’ drop down to ‘above all posts’. Now save your settings.

This tells Thesis that if there’s a feature box function, display the contents of the feature box in the content column, just above the first post title – and only do it on the home page.

Step 2 – Create a Thesis Hook

Open your Thesis theme’s custom_functions.php file in your favourite text editor and insert the following function and hook to display the feature box:

function add_feature_box() {
?>
<p>Insert your intro paragraph text here</p>
<?php
}
add_action('thesis_hook_feature_box', 'add_feature_box')

What we’ve done here is:

  • We’ve created a new function called add_feature_box
  • Within our function we’ve added the HTML content that will display our new Bing-friendly introduction.
  • Finally we’ve tied the function into Thesis using a hook (thesis_hook_feature_box)

Step 3 – Style your Feature box

Finally we’ll need to style our new feature box to make it look pretty. I’ve gone for some basic styling for my example, but you could technically do whatever you like. The following CSS needs to be added to your custom.css stylesheet.

#feature_box {
	background: #f5f5f5; border: 1px solid #ddd;
	font-size: 1.4em;
	line-height: 1.5em;
	padding: 10px;
	margin-right: 21px;
}

The #feature_box div is part of the Thesis core, so we’re simply styling the look and feel of the box. And because the feature box is inserted before any of Thesis’ content styling takes place, we need to assign a font size, line height, padding and margins to match the default Thesis CSS styles.

For all my whining about Thesis’ complicated hook system, that was actually pretty easy. So simply upload your custom_functions.php file and custom.css file to your Thesis theme’s ‘custom’ folder, and you’re done.

I don’t know for sure that this is going to work with Bing, but I suspect that it will, and either way it provides a nice easy introduction to a blog. If you have any problems/questions/comments/complaints, please feel free to tell me about them in the comments.

  • http://kevinw.me Kevin Williams

    Great to the point blog post, however I was searching for a way to create a entirely new hook-position.

    My post metas are set to show up @ thesis_hook_after_post or after_post_box but they show up only on pages not blog posts: http://bit.ly/elCNPe

    Not sure if creating a new hook position is doable or even the fastest way, could use some pointers.

  • Dave

    @Kevin are you using the Feature Box hook for this? It’s possible that you need to change the display settings in the Thesis > Design Options panel if you are.

    You can’t create hook positions (without hacking the Thesis core), but I’ve yet to find a need to add a hook position. If you mail me a more detailed description of what you’re trying to achieve I’ll see if I can help you out.

  • http://kevinw.me Kevin Williams

    Thanks so much for the reply. What I did was put the post metas “thesis_hook_comment_form_top” – Then I used some CSS positioning to move it about the text “Leave a Comment.”

    This works as long as I don’t allow comments on pages, which I don’t think I will need to do. When I had the post metas anywhere else they were showing up all over.

    http://pri.kevinw.me/fundx/wordpress/?p=88

  • Dave

    @Kevin that’s a nightmare way to do it. Try it using a WordPress conditional statement (is_single = single blog posts):

    
    function custom_postmeta() {
    if(is_single()) { ?>
    ...add your HTML here
    < ?php }
    }
    
    add_action('thesis_hook_after_post' , 'custom_postmeta');
    

    NB: for some reason WordPress is adding a space after the opening PHP tag. You'll need to remove it for this to work.

  • http://kevinw.me Kevin Williams

    Wow thanks!

    Thanks exactly the kind of thing I was looking for but didn’t know if there was a “if single blog post”