3826 readersRecently, a client of mine asked me to write an article importer for his WordPress powered site, which was a very interesting project for me. In this article, I'll show you how you can easily add data (posts, comments, categories, etc) to your WordPress blog, without any manual effort.Like CatsWhoCode? If yes, don't hesitate to
3004 readersIs your blog popular? Do you got receive lots of comments from your readers? If yes, what about displaying the most recent comments in your blog sidebar (or elsewhere) to let your visitors knowing about the discussion?Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!Display
4208 readersBy default, when the blog admin left a comment on his blog, WordPress use the name in the comment css class. This is useful for styling, but it will also let people know about your admin login name. If you want to hide this info, read this recipe.Looking for WordPress hosting? Try WP Web Host.
3326 readersHTML in comments can be a good things, but many times people abuse it, for example by inserting links. In this recipe, I'll show you how you can automatically get rid of any HTML entered in your post comments.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it
8655 readers
PHP
function top_comment_authors($amount = 5) {
global $wpdb;
$results = $wpdb->get_results('
SELECT
COUNT(comment_author_email) AS comments_count, comment_author_email, comment_author, comment_author_url
FROM '.$wpdb->comments.'
WHERE comment_author_email != "" AND comment_type = "" AND comment_approved = 1
GROUP BY comment_author_email
ORDER BY comments_count DESC, comment_author
3902 readersYou might want to have comments displayed on different spots. For example, displaying the last x comments in a central template. This requires the latest comments or all comments on your site. This is a small solution that scans all the comments, or a certain number, and is supplied with markup. The following code for
3655 readersDo you know that it is possible to insert post in WordPress programmatically? In this recipe, I'll show you how to do it easily.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!WordPress tip: Insert posts programmatically
4402 readersIn blogging, it is useful to be able to display your most popular posts. There's WordPress plugins to do that, but you don't need it: This code will display your most popular posts, accordoing to the comments count, without requiring you to use a plugin.Looking for WordPress hosting? Try WP Web Host. Prices starts at
5 readers
For the past few days I’ve had some real trouble trying to comment on other blogs. I would make a comment, and it would seem like nothing happened. No “Your comment is awaiting moderation.” message would show up. Same story even with blogs I’ve had previously approved comments on.
I started to suspect
3767 readersDisplaying all the comments on a Post is incredibly easy. In your single.php file you probably have a line like this:
<?php comments_template(); ?>
That line basically calls/includes your comments.php file. Within that, the line to output all comments is something really simple like this:
<ol class="commentlist">
<?php wp_list_comments(); ?>
</ol>
But that doesn’t leave much by way