Many ways can be done to decorate your website or blog, make it unique, or make it more friendly to visitor, including addressing commenter. To help you understand how this post means, please pay attention to the comment box of this blog. There, you'll see "Selamat datang Sobat!" which means "Welcome Guest!", that is addressing commenter means. If visitor has made a comment, the address word will certainly different depend on the commenter names. As example, if you comment and fill your name as "Mr. Smith", then the addressing word will change to "Welcome Mr.Smith"
It so easy to apply this for your blog, all you need to is just add the following code to your wordpress theme, in your comments.php file exactly.
You may put it anywhere in your comments.php file, You can put it before comment box, along with the commenter id, or may be after the comment box, as long as it fits and match your template.
Want to make your blog more user friendly? Then try to give them Stylish customizable TOC to let your visitor explore your site easily.
Before: "Welcome, Guest!"The process utilize cookie from your browser when you visit the blog, so if you visit the blog in the future the blog will recognize you until you clear cookies from your browser. Certainly it will make your blog user friendly and let the visitors treated as if you were welcoming them:
After: "Welcome, Mr. Smith!"
<?php if(isset($_COOKIE['comment_author_'.COOKIEHASH])) {
$lastCommenter = $_COOKIE['comment_author_'.COOKIEHASH];
echo "Welcome Back ". $lastCommenter ."!";
} else {
echo "Welcome, Guest!";
}
?>
You may put it anywhere in your comments.php file, You can put it before comment box, along with the commenter id, or may be after the comment box, as long as it fits and match your template.
Want to make your blog more user friendly? Then try to give them Stylish customizable TOC to let your visitor explore your site easily.