Posts Tagged ‘Wordpress’

Adding Extra Default Available Wordpress Widgets

Sunday, October 26th, 2008

Today I was working on my band’s website, which is based on Wordpress. The site contains two different sidebars, 1 and 2. I encountered a problem when after I added the Search sidebar widget to sidebar 1, it was ‘used up’ and I could not add it to sidebar 2 also. After some brief searching and thinking, I realised what I could do.

(more…)

Customising Wordpress Comments

Friday, October 24th, 2008

I recently started working on a review site based on Wordpress. It was clear that the easiest way to achieve review functionality was to use the Wordpress comment system. Basically, items were added to the site as posts, and post comments would serve as reviews for the items.

Having made the decision to use the comment system, I needed to then add some extra fields to the comment form, which would accept pieces of information that were part of the reviews. I searched around briefly for some information on the web regarding how to modify the Wordpress comment system, but could not find much, hence I have written the following short account of how to add custom field to the Wordpress comment system.

(more…)

Wordpress > 2.5 and contributors can not load images

Monday, September 1st, 2008

There seems to be an issue with Wordpress 2.5 and greater regarding the inability of Contributors to upload media to their posts. When someone with Contributor permissions tries to upload, say, an image, they are greeted with the following message:

You do not have permission to upload files.

Well, I am not sure if this is a bug; it might be a design decision. Either way, versions of Wordpress prior to 2.5 do allow Contributors to upload media to their posts, so people who upgrade from pre 2.5 to post 2.5 might be affected by this difference.

A neat way to get around this issue is by installing the Role Manager plugin, activating it and granting contributors the right to upload files.

PHP $_SESSION in Wordpress

Thursday, August 21st, 2008

I was recently writing some code for an application based on Wordpress when I realised that I would need to retain data across pages. Naturally, I opted to use PHP session handling. A quick search for the string ‘_SESSION’ suggested that Wordpress does not use the $_SESSION superglobal array. Therefore, if you are going to simple user $_SESSION in your code, you will need to place session_start(); somewhere in the code, either in a core Wordpress include file, a plugin file or in a specific file(s).

Finally, if the session handling is used as part of the Wordpress administration backend, you will probably want to terminate the session when the user logs out. To achieve this, you can simply create a function that destroys the session and call this function during the ‘wp-logout’ hook.

function clear_session() {
session_destroy();
}

add_action(’wp_logout’, ‘clear_session’);

Using Wordpress as a Forum

Saturday, August 9th, 2008

I was recently asked to set up a basic forum system for a client. They were using Simple Machines Forums, but it wasn’t working smoothly. Rather than trying to address the issue, I opted to try out the bbPress forum software based on Wordpress. The two main reasons were: (1) its simplicity (2) the fact that it is based on Wordpress, which my client’s are already familiar with. So I installed it and liked the simplicity and elegance of the system. However, one problem with bbPress relative to my client’s needs, was that there is no way to upload images and insert them into posts.

Now, knowing that Wordpress has a nice little WYSIWYG editor with an associated image uploading and insertion feature, my first thought was to try and hack bbPress by migrating in the Wordpress editor. I spent a small amount of time trying to achieve this with little apparent success. Instead of continuing down this path, I started to think about the possibility of making a few modifications to Wordpress to get it to act more like a forum. Fortunately, a quick Google search later and I found that someone had already created a theme and plugin combination for Wordpress which does this very thing.

The theme (TDO Forum Wordpress Theme) can be found at http://thedeadone.net/software/tdo-forum-wordpress-theme/ and the plugin (TDO Mini Forms Wordpress Plugin) can be found at http://thedeadone.net/software/tdo-mini-forms-wordpress-plugin/.