Getting SexyBookmarks to Appear Above Linkwithin

If you have a blog, chances are you’ve installed a plugin to enable easy sharing of your content on some of the most popular social media and sharing sites.  You also may have installed LinkWithin, which is a great plugin to show someone other posts you have written that deal with the topic of the current article.  If you have installed SexyBookmarks by Shareaholic and LinkWithin, by default they appear in what I think is the wrong order.  You would want the sharing links directly  under the article, with the links to the other articles underneath that.  Since you want people to share your article, and then move on to other articles.  You can’t really share the previous post as you are viewing the next post, right?

So, in order to flip them around to the correct order, you only need to add a simple line of code to your templates.  If you are on a theme, it may be a little more difficult for you to find, but what you are looking for is the posts themselves… so typically it will start out with <div class=”post”>  or something to that nature.  Once you find that (typically in your main index.php or your single post located in single.php).  Next you will see the WordPress loops which call for the individual posts, they look something like…<h2><?php the_title(); ?>” href=”<?php the_permalink() ?>” rel=”bookmark”><?php the_title(); ?></a></h2>, and then some more of that calling the_content, and maybe even some code to call for the tags of the post.

Right before the </div> closes for the post so at the end of all of that, but before the </div> you would place this line of code (after you have both plugins installed and running)

<div class=”linkwithin_div”></div>

Save the file and refresh the page and see what you get!  If it ends up blowing up your site, then just go back into the editor and remove that line of code.

I apologize for speaking a little bit of a different language, but sometimes there is just no easy way to explain code.  🙂  Any questions feel free to ask!  Or you can hire me to just do it for you.

This post may contain affiliate links, which means I receive compensation if you make a purchase using the links.




Click here to post a comment

  • I’m using a child theme (Serenity Genesis Child Theme) and I don’t have an index.php or single.php file in the theme folder and I can’t find anything about in any of my theme files. Is there another place I should be looking?

  • ummm… yeah… it will be a little harder for you, as the code is going to be within a function. If you want to hire me to do it for you it would be $15 for the code fix (according to my prices under the blog help tab at the top). Just email me at if you want me to do it. Otherwise you are going to be looking in a functions type file (probably under your lib) and you’ll have to find the right code within the functions.

  • Hey Sarah, I’m the Marketing Manager here at Shareaholic. This is an awesome post you wrote last year! Thanks for taking the time to outline this to your readers. I just wanted to thank you for the write-up (a little belatedly) and let you know that we just launched our own related content widget that you can install directly in our plugin. Here’s a link if you want to take a look:

    Thank you again! 🙂