Thursday, July 5, 2007

How to forward traffics from my blogger to the same post on my WordPress blog

BloggerBefore I moved all my blogs to my own WordPress blog platform (http://eblog.lichao.net), I was using blogger (http://lichaonet.blogspot.com) to write articles. I like my wordpress blogs now, but I still want to keep posting new articles on the blogspot site. First, I can use it as my backup or mirror blog sites. Second, I personall think that the blogger is better on Google search than wordPress blogs. But it is very difficult to manage multiple blogs on the same topic. One of these challenges is to centralize all the comments on only one blog site.

Since the wordpress one is my main blog site, I try to collect all blog comments on this blog. What I need to do is to 1) disable all comments feature on other mirror blog sites; 2) create a link to forward all visitors on mirror sites to my main blog for commenting.

1) Hide comments on blogger site

Log onto blogger.com and select Setting --> Comments. On Comments page, you can select Hide to hide all existing comments and the links to post comments.

When you save setting and re-publish your blog, you will see all comments disappear, so do the number of comments on each post and comments section at the end of posts.


2) Make a link to the new blog site

Now I want all visitors who first enter my blogspot site to see a link to point them back to my new blog site, then they can leave their comments over there.

I can manually put the perm links of each post on the mirror site, but this way will increase my workload extremely.

Yes, I can just put a link to the front page of my main blog site (http://eblog.lichao.net) on every post by changing the tempate HTML. But it will cause problems for visitors who have to look for the individual posts on my main blog site.

In theory, I can programmingly insert a perm link to the individual post. But unfortunately my Blogger and WordPress use different Perm Link pattern.

Here is the comprise way I could think of, to insert a title search link to eblog.lichao.net on blogspot since both main blog and mirror blog posts are on the same post title.

In new version of blogger

Dashboard -->Layout --> Template --> Edit HTML. And check Expand Widget Templates check box.

In the HTML text area, I locate the tag of <b:if cond='data:blog.pageType != "item"'><b:if cond='data:post.allowComments'> ,and insert my own link before this tag.


<!-- added on 2007-07-06 to link back to my main blog -->
<a class='comment-link' expr:href='"http://eblog.lichao.net/?s=" + data:post.title'>View Comments</a>

The data:post.title in above code can automatically display the same post on search result of my main blog site.

One more place you should edit too, which is the comment section after each post. I locate the tags

<b:includable id='comments' var='post'>
<div class='comments' id='comments'>
<a name='comments'/>

<b:if cond='data:post.allowComments'>

and insert the following codes between them, so the final code looks like

<b:includable id='comments' var='post'>
<div class='comments' id='comments'>
<a name='comments'/>
<!-- added on 2007-07-06 to link back to main blog -->
<a class='comment-link' expr:href='"http://eblog.lichao.net/?s=" + data:post.title'>Please click here to leave your comments</a>
<b:if cond='data:post.allowComments'>

Classic version of blogger

There are a little differents in the classic version. In classic, I use "<$BlogItemTitle$>" to pass the post title to the new blog site.

Open Edit HTML from Template, and locate the tags of

<p class="post-footer">
......
<BlogItemCommentsEnabled>
<a class="comment-link" href="<$BlogItemCommentCreate$>"<$BlogItemCommentFormOnclick$>><span style="text-transform:lowercase"><$I18NNumComments$></span></a>
</BlogItemCommentsEnabled>

And insert my own following code after the tag of </BlogItemCommentsEnabled>.

<!-- added on 2007-07-05 to forward traffic to new weblog site -->
<a class="comment-link" href="http://eblog.lichao.net/?s=<$BlogItemTitle$>" target="_blank"><span style="text-transform:lowercase">Comments</span></a>

I did the same for the comment section of each post which is usually after the tag <!-- Begin #comments -->
. Here is the final code for comment section.

<!-- Begin #comments -->
<ItemPage>
<div id="comments">

<!-- added by Chao on 2007-07-05 to forward traffic to new weblog site -->
<p style="padding-left:20px;">Thank you for visiting, please go to<a href="http://eblog.lichao.net/" target="_blank">my main blog site</a> and leave your comments over there. To locate the same topic, please click the link on <a href="http://eblog.lichao.net/?s=<$BlogItemTitle$>" target="_blank">Search Page</a>.

<BlogItemCommentsEnabled><a name="comments"></a>

-- The End --

Technorati :
Del.icio.us :

Sponsor Ad.