Like the Disqus in this blog, I have just added LinkWithin related posts widget. I don’t want to load a lot of stuff, a simple loader button, I am okay with that.
Note
2013-11-10T04:10:34Z: I have replaced LinkWithin—because the results are not so related—with two alternatives: nRelate and Outbrain.
Initially, LinkWithin gives me this piece of code:
<script>
var linkwithin_site_id = <THE_ID>;
</script>
<script src="http://www.linkwithin.com/widget.js"></script>
<a href="http://www.linkwithin.com/"><img src="http://www.linkwithin.com/pixel.png" alt="Related Posts Plugin for WordPress, Blogger..." style="border: 0" /></a>
With some testing, my final addition to my template is:
<section id='post-related'>
<h2 id='linkwithin-related-posts'>Possibly (not) related posts</h2>
<div class="linkwithin_div"/>
<script>var linkwithin_site_id = <THE_ID>;</script>
<input id='linkwithin-loader-button' onclick='$.ajaxSetup({cache:true});$.getScript("http://www.linkwithin.com/widget.js");$.ajaxSetup({cache:false});$(this).remove();' style='width:100%;margin:10px auto;' type='button' value='Click to load related posts via LinkWithin'/>
</section>
with:
#linkwithin_text_0 {
display: none;
}
It’s very similar the one for Disqus, only changes the values and links. I use CSS to hide LinkWithin’s heading text, which doesn’t work very well with my layout, instead of changing text via:
<script>linkwithin_text='Your custom text:'</script>
In the official code, there is a 1x1 image link, I thought I might need it to make sure crawling working, because I suspect that’s how LinkWithin being aware of a post. But after clicking on few posts, it can show me related posts, although they don’t seem related at this moment. Anyway, that image link isn’t required from what I’ve seen.
Now, why I want to add LinkWithin? Because for the last year, I have been manually adding related posts lists to posts. I must say, I don’t like that, because my posts are in VCS, so any modifications will create new commits. Using automatically generated lists have its trade-off, they might not be actually related to the post, but that’s a trade I am willing to exchange with the amounts of commits.
Anyway, I was hoping there is a even easier method, like a link, which leads to related posts service’s website, where they give you the list. I don’t mind redirect readers to other sites, but there seems to be none of such way of providing related posts list.
Enjoy the thumbnail’d related posts!
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.