Peter Bargh

words pictures sounds
February 13th, 2014

Permalink changes lock you out of WordPress Admin?

I had this problem and couldn’t work out what I’d done wrong

I installed WordPress in a .com/blog directory

It all went well. I could log in to admin and I could see the live blog. Then I went into Settings>Permalinks to change Default to Post Name and then when I saved changes I was directed to the log in page and the log in no longer let me in…and the public side didn’t work either.

If this happens to you it’s likely there’s something wrong with the .htaccess file and here’s a quick fix

delete your current .htaccess in the /blog directory
upload a new blank replacement .htaccess
set chmod permissions to 666
Log in to wp-admin and set permalinks to desired url structure
Return to .htaccess file and set permissions back to 644 for security

It should now work correctly

September 4th, 2013

 appearing in WordPress posts following mysql database import

If you experience the problem of an  appearing in seemingly random places throughout you WordPress posts following a database import you may be able to solved it like I did by commenting out the encoding line in your site’s wp-config file:

Search for

define(‘DB_CHARSET’, ‘utf8?);

and add // to the front:

// define(‘DB_CHARSET’, ‘utf8?);

This should make the Âs disappear.

August 24th, 2010

Fatal error: Allowed memory size exhausted in WordPress 3.0 upgrade

Have you upgraded to WordPress 3.0 and got the following message when trying to automatically update to 3.01?

Fatal error: Allowed memory size of xxxxxxxx bytes exhausted (tried to allocate xxxxxxxxx bytes)

I used to get that error on older versions of WordPress from time to time and resolved it by editing the wp-settings.php file. There’s a line that says define(‘WP_MEMORY_LIMIT’, ’32M’); and a quick edit to define(‘WP_MEMORY_LIMIT’, ’64M’); used to sort the problem out.

But on a recent attempt to upgrade from 3.0 to 3.01 I got the error and found the memory allocation in the wp-settings.php file is split out as an include file on line 20

require( ABSPATH . WPINC . ‘/default-constants.php’ );

and the “default-constants.php” file, with its memory settings is in the wp-includes folder and appears to now be correctly specified at 64M. After some research I found a site that suggested increasing this to 128M, or 256M I tried both and neither worked.

Another site suggested changing the PHP.ini file’s memory from 32M to 64M, but I use Namecheap and I don’t have access to that file.

I finally found the answer that worked for me.

Locate the .htaccess file in the WordPress root folder and add this line:

php_value memory_limit 64M

That worked fine. I hope that helps you too.

October 13th, 2008

Images not right aligning in WordPress

If you’re like me and have a wordpress blog that you’ve updated to 2.6 you may have found that you cannot right align photos in your blog posts.
This is because many of the site templates are not totally up to date.

The solution is to edit your CSS style sheet
1 Go to your Site’s admin panel
2 Click on the Design tab and then Theme editor below the tab. It should bring up the style sheet (style.css) If not look at the Theme Files list on the right.
3 Click the Ctl+F to bring up a search window and key in img right or even just img r and click next.
4 Find the line

img align left{ float:left; margin:0 12px 5px 0; }

and change it to

.alignright { float:right; margin:0 0 5px 12px; }

This will then ensure that images are right aligned.