Using code to make comments look good on a blog


A Few Words about the Code

I’ll be keeping things as conceptual and straightforward as possible. That way, the actual usage of the various template tags and functions come into play, rather than being obscured by other code that won’t matter in the long run. That being said, you should be aware that the following examples include localization tags and both template and conditional tags that you may not be entirely familiar with. Most of the latter two categories speak for themselves, but localization may be a bit harder to grasp. You’ll get to the details of that later on, but for now you only need to know that when you localize, you either wrap the text/code within _e() or __(). You use __() within PHP code, while the former is more or less used anywhere. Add a textdomain and you’ve got the basics, like this:

<?php _e('This text can be localized, mate!', 'the-textdomain'); ?>

Both _e() and __() rely on the premise that the text or code you can localize gets passed first, and then the textdomain that should be used. In the Notes Blog Core examples, the textdomain is called 'notesblog', so it would look like this:

<?php _e('This text can be localized, mate!', 'notesblog'); ?>

Then, thanks to language files, users can fully localize the theme.

Making Comments Look Good

Not all sites need comment functionality, but chances are that a lot of the sites you’ll be building with WordPress will. Most, if not all, blogs allow readers to comment on the posts, and the same goes for the vast majority of editorial sites out there, from newspapers to magazines. It is just a good way to connect with the readership, and while the sites in question may have completely different motives for doing this, and may have different comment policies, the basic functionality remains the same. From a WordPress theme designer’s point of view, comments can be a bore, mostly because making them look good can be a problem.

The actual code isn’t all that hard, though, and if you like the default comment view (as featured in the default WordPress theme) you won’t even have to create the comments.php template file. We looked closer at such a file in the “A Closer Look at the Notes Blog Core” section earlier in this article, so we’ll gloss over that part for now and look at the comments from a less technical point of view for a little while. These are the most important things to consider when designing the comments section of a site:

Think the comment functionality through and you’ll be fine. You’ll also have a much easier time designing it, and possibly altering the functionality as well.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Articleinput.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.

Note: This article was sent to us by: Keith Branger at 05172010

Related Articles

1. Working with Image Galleries in Wordpress
Fun with images It’s said that a picture is worth a thousand words. Or maybe it speaks a thousand words, I’m not sure. The point is that an image ...

2. Making the Most of Image sharing Services in Wordpress
Making the Most of Image-sharing Services For sites running on limited hardware or shared hosting accounts, it may be crucial to save on both space and bandwidt...

3. Show off Your Twitter for Wordpress
Integrating the social web Before digging into the various techniques used to display and connect to the social Web, it is important not to forget the most ob...

4. How to do lifestreaming with WordPress
Lifestreaming with WordPress Lifestreaming is a term commonly used to describe the mashing up of everything you do online. A bit presumptuous, perhaps, to assum...

5. Social Web Submit Buttons plugin Worspress
Social Web Submit Buttons The social Web is certainly a big consideration when working with editorial content today. While search engines can trickle in visitor...

6. Wordpress Hosted Comment Solutions
Pimping the Comments With the addition of threaded comments in the WordPress core, and the excellent CSS styling options that are now available, as well as the ...

7. How to Backing Up database for Wordpress
Backing Up Anyone who has lost data in a hard drive crash or similar knows the importance of backing up, and it goes without saying that this applies to your on...

8. What you need to know about the Wordpress database
Hacking the Database Most of the time you needn’t worry about the database; WordPress will do that for you. There are database changes between versions so...

9. Switch hosts with wordpress when export and import do not work
WordPress and Switching Hosts There are several ways of moving to a new server. My preferred one is using the Export/Import functionality found under Tools in W...