Tag Archives: PHP

How to Move Comments in WordPress 3.0 with phpMyAdmin

Many of the Move Comments plugins for WordPress do not seem to work properly in WordPress 3.0, so I needed a way to move comments around from one post/page to another, as well as retain any threaded/nested comments. One could always move comments by modifying the database directly with phpMyAdmin or something similar, and this is what I had to resort to. Modifying your WordPress database directly isn’t something you want to do every day, but sometimes it is completely unavoidable. It took me all of 5 minutes to figure this out, so it shouldn’t be too difficult for you either.

Continue reading

How to Use Custom PHP Functions and Shortcodes in WordPress

I touched on this subject before in my previous article titled WordPress Tip: the_category Without Links, which focuses on the WordPress get_category function, but I decided to write this article so I can focus more on the general implementation of PHP functions with WordPress, and so that people will have an easier time locating these tips via a web search.

Some WordPress plugins require you to add shortcodes to your pages/posts to utilize the plugin, so I wouldn’t be surprised if you were already using shortcodes. Whether or not you’ve had any experience using WordPress shortcodes, this tutorial has what you need to get started.

Continue reading

How to Use the_category Tag Without Links in WordPress

You see, the_category template tag outputs the name of every category a post belongs to, but the category names are linked to respective category pages that I do not want my visitors accessing. Here on GlassOcean.net I try to obscure the category pages that WordPress generates because they are not as customizable as I would like. Therefore, I needed a way to list the categories that a post belongs to without the links.

A Google search for “wordpress the_category without links” returned an article by Robert Mirabito titled How to remove link from the_category in WordPress, which led me to the understanding that I would need to use the get_the_category template tag instead of the the_category template tag. However, Robert’s example inserts a space character as the delimiter, and changing this delimiter to something else results in the delimiter appearing after the very last category. So if you used a comma character as the delimiter, you would end up with something like “Posted in Blog, Services,” which looks bad. This led to some more searching.

Continue reading