Category Archives: Wordpress

WordPress Users Plugin Moving to GitHub

I am still not planning on continuing development on the WordPress Users plugin. However, rather than kill it entirely or let it linger in the WordPress Plugin repository, I thought that it might be better served to move the codebase to GitHub. I hope that putting the project on GitHub will bring more visibility to it so that others may be encouraged to contribute to the development of the plugin.

Make sure to get the latest version from GitHub instead of the official WordPress Plugin site. If you are using it and have a problem or a question, please create an issue there. If you want to contribute, please submit a pull request. I will try to help out where I can so that others my still find it useful.

Sync Comment Number in IntenseDebate with WordPress

I have been handling a lot of WordPress development at work recently. At my job, all of the blogs are using IntenseDebate to handle blog comments. This presented a problem to me recently with launch of a new theme I was working on.

The problem is that on a post, IntenseDebate would show one number of comments while the post detail info would show a different number. I tried several different methods of fixing this to no avail. IntenseDebate does not have much in the way of documentation, and the system itself leaves a lot to be desired.

It turns out that, IntenseDebate doesn’t automatically sync comments with WordPress, and instead uses a JavaScript method to sync the comment numbers on page load. Go figure! The reason why it wasn’t working for me is that I was using a custom function to get the number of comments on a post.

To get your comment numbers to sync, you need to use the WordPress provided template tags, comments_number() or comments_popup_link(). This fixed the problem for me.

I hope that this helps someone else, as there is not much info on this out there that I could find. And avoid IntenseDebate if you can.

How to Create a Google Analytics Plugin for WordPress

After creating my bbPress Google Analytics plugin, I wanted to do the same thing for WordPress. It is just as easy to do this as it is for bbPress. Your WordPress footer template should have a hook for adding code to the footer. If it doesn’t have this hook, you just have to add this piece of code, wp_footer();, to your footer template. Then you just have to create the code that will add your tracking script to the footer of every page. That is it.

Here is an example of the code you can use. Download wp-analytics here. Just upload the script to your plugins directory, and activate the plugin in the plugin admin. If you are using Google Analytics, all you need to do is replace “UA-XXXXXX-X” with your site code. But it will work with any tracking script, just replace the Google script with your own. Also you can use this same code to add any code you wanted to the footer.

WordPress Users and Site Updates

I just released version 1.1 of WordPress Users. If you are upgrading from a previous version, please check your settings, as they have changed. Avatar and user description display are now optional, so you must enable them for them to show up. Also, user description character limit can now be changed, so check that setting as well.

I just implemented open registration on this site. You should be able to login or register from the sidebar. I also launched Kempwire Forums. The forums are mainly for support of my WordPress plugins, and the site registration is mainly for the forums. If you register on the site, you can use the same login for the forum and vice versa.

Update: the forums have been taken offline for the foreseeable future.

For support of plugins, I am leaving comments open on the plugin pages for now, but I appreciate it if all discussion will be added to the forums. Please let me know if you have any questions. Thanks!

Add Threaded Comments to Your Theme in WordPress 2.7

One of the improvements added in WordPress 2.7 was official support for threaded comments. Previously, this functionality was only available through plugins. But now that threaded comments are available, you need to make sure that your theme is compatible.

To do this, you need to add a couple of things to your theme. First open up header.php in your theme, and add this line in between the head tags, preferably right before the wp_head function.

<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>

This adds the javascript required for threaded comments to any page or post where you have comments enabled, but not on the index or archive pages.

Next open up comments.php in your theme and make sure this code is in there.

<ol class="commentlist">
<?php wp_list_comments(); ?>
</ol>

This code should replace your comments loop. To see an example of this, see comments.php in the default theme in 2.7. Once this is done, you need to activate threaded comments. Go to “Discussion” under “Settings” in your WordPress admin, and check the box that says “enable threaded comments.”

Another important step is the CSS. You need to style your comments properly for the threaded comments to be as functional as possible. For an example, again check out the CSS from the default theme in 2.7. You also need to be aware of how many levels your comments will be nested in your CSS. WordPress allows you to set this in your backend. The default is 5. With those steps, you should be good to go.

The wp_list_comments is an important function for other reasons. It also gives you the ability to sort comments, add gravatars, add CSS hooks for even and odd comments and author comments. So even if you don’t want threaded comments, it is an important function to have in your theme, especially if you are developing themes for public release.

Update: It turns out following the instructions above didn’t work for me. You still need the js file in your header, but there are more changes to comments.php than I thought. The easiest thing to do is to just copy the comments.php file from the default theme in 2.7 to your theme and modify that file to your liking. This finally got threaded comments working for me.

Updated Ultimate Noindex Nofollow Tool

The Ultimate Noindex Nofollow Tool lets you add the “noindex” robots meta tag to archives, categories, search pages, tags, author pages, login, admin pages or any other page you choose. Also, you can add the rel=”nofollow” tag to archive links or category links.

The latest version gives you the ability to add rel=”nofollow” to any page link from the wp_list_pages function or Pages widget.

The Ultimate Noindex Nofollow Tool is here, and you can download the Ultimate Noindex Nofollow Tool here. I hope you find it useful. Let me know of any problems or questions.

The Ultimate Noindex Nofollow Tool for WordPress

It seems I’m really into writing WordPress plugins lately. I’m also into WordPress SEO. My latest plugin combines the functionality of some of the previous SEO plugins I wrote, plus some new functionality of its own.

It’s called the Ultimate Noindex Nofollow Tool. It combines the Nofollow Archives, Nofollow Categories and the Noindex Login plugins. You can now add the “noindex” robots meta tag to archives, categories, search pages, tags, author pages, login, admin pages or any other page you choose. Also, you can add the rel=”nofollow” tag to archive links or category links. The next version, which I am working on now, will have the ability to add rel=”nofollow” to any page link from the wp_list_pages function.

If you care about WordPress SEO, you should be using this plugin or a similar one. I’m working on a WordPress SEO post, where I will detail what you should do and how you can use this plugin to improve your WordPress SEO.

The Ultimate Noindex Nofollow Tool is here, and you can download the Ultimate Noindex Nofollow Tool here. I hope you find it useful. Let me know of any problems or questions.

Add a User Directory to Your WordPress Site

I’ve recently been experimenting with community on WordPress, and I wanted to enable user registration on a WordPress site. This was easy enough, but once a user has registered there is no easy way for them to interact with the site, other than the way they normally would.

With WordPress, you can display authors in your sidebar, but there is not really a way to display profiles for registered users. So I ended up writing another plugin to handle this. The WordPress Users plugin creates a directory of user profiles on any page you specify on your site. Each user gets their own profile page that displays the date they joined and recent comments. It has support for Gravatars and permalinks. User links are nofollowed. You can also tell search engines to noindex, follow the directory pages. Also, there are plenty of hooks to style it yourself with your theme CSS file.

The WordPress Users page is here, and you can download the WordPress Users plugin here. I hope you find it useful. Let me know of any problems or questions.