Archive for the ‘WordPress Tips’ Category

Reset WP Password Manually

Saturday, April 26th, 2008

Ever wanted to reset your password in WordPress, but for some reason or other you can’t use the reset password section? 2.5.1 has a bug where the reset password page doesn’t work, so this might be handy for you.

The phpMyAdmin way

Browse into the wp_users table in your database. Find your username and click on the edit icon () next to your username.

On the edit page, select MD5 from the Function dropdown next to the user_pass row. Change the value on the user_pass row to your new password and then hit Go.

Now log into WordPress with your new password and it will upgrade your password to the new phpass hashing.

The SQL query way

This applies where your database is wordpress and your login name is admin. Replace PASSWORD with whatever you want your new password to be.

UPDATE `wordpress`.`wp_users` SET `user_pass` = MD5('PASSWORD') WHERE `wp_users`.`user_login` = 'admin' LIMIT 1;

After you login on your WordPress installation, it will upgrade your password to the new phpass hashing.

WordPress Automatic Upgrade Tip

Monday, April 7th, 2008

As a tip to everyone who uses WordPress 2.5 and needs to input their FTP details every time, you can force WordPress to remember them by adding this to your wp-config.php:

define('FTP_HOST', 'ftp://example.com/');
define('FTP_USER', 'example_user');
define('FTP_PASS', 'example_pass');
//Set to true if your host uses SSL connections
define('FTP_SSL', false);

This can be reduced to just your password, if your database already remembers the other details.

Making a magazine in WordPress: Issues

Sunday, March 30th, 2008

I’m currently making a WordPress magazine site. Among other things, it needs to show only the posts from the current issue on the front page. It uses categories to mark which issue an article belongs to.

I thought I’d share the code to do this, as it may be of use to some of you. This code sits just before your loop in index.php. It takes all categories under category 8 (the ‘Issues’ category for the magazine), gets the ID of the most recently added category under these and then sets the query to use that.

Please use at your own risk, etc:

$category = get_categories('child_of=8&order=DESC');
$category = array_values($category);
query_posts('cat=' . $category[0]->cat_ID);

Hi. I live here to keep the peace. You can ignore me now :)