Category Archives: wordpress_dev

WordPress media “has failed to upload due to an error”

A quick checklist for myself, because this problem nearly always seems to occur on a fresh WordPress install, and it’s easy to forget what works!

1. Create the uploads folder yourself, in lowercase – “uploads” not “upLoads”

2. upload this folder to the wp-content folder

3. change the uploads folder’s permissions to 777 (and temporarily change wp-content to 777 as well just to be sure)

4. go to settings > media and add the full url to the uploads folder into the “Full URL path to files” field.

5. upload an image

6. reset permissions for wp-content to what they were to start with.

No guarantees but it seems to work for me.

note: Since I originally put this up we have started using a different isp and the problem rarely occurs now, so the solution above is probably a solution for specific situations rather than across the board. However anything is worth trying if you’re stuck so I hope it’s useful to someone!

 

WordPress, Tinymce, br class=”spacer_”, and unwanted white space all over the place

Using WordPress with the TinyMCE advanced plugin, if you view your content in the html editor all the p and br tags are stripped away by default.

If you are used to working with ‘proper’ html you probably won’t like that.

You can get your p’s and br’s to display again by checking ‘Stop removing the <p> and <br /> tags when saving and show them in the HTML editor’, on the tinyMCE settings screen.

However you will probably start to find nasty unwanted white spaces appearing all over your pages:

<p><br class="spacer_" /></p>

has been inserted all over the place, seemingly at random.

I can’t find a way to stop this happening (trying to hack TinyMCE is beyond me) but the following jquery at least hides the unwanted empty lines.

$("p br.spacer_").each(function () {
$(this).parent().addClass('displayNone');
});

where the displayNone class hides the p.

If you do want an empty paragraph somewhere on the page, use

<p>&nbsp;</p>

and the jquery won’t hide it.

 

WordPress widgets not working?

We recently had the apparently common problem where suddenly we could not drag, drop, open, close, or do anything else with the widgets in the WordPress admin.

The advice to fix this usually begins with turning off all your plugins and is usually followed by lots of comments about how people have done this to no effect.

Luckily for us we found a piece of advice that fixed the problem without the need to do any of this.

Just upload and activate the following plugin: Use Google Libraries

No guarantees but it worked for us.

 

WordPress broken rss feeds

I had a broken rss that read “XML Parsing Error: XML or text declaration not at start of entity…” on a WordPress site.

There are many fixes suggested for this on the web, and I tried many, including changing themes, deactivating all plugins, adding new plugins etc etc, none worked.

The one that finally did work can be found at www.w3it.org/blog/wordpress-feed-error-output-solution-how-to/

Thank you w3it, I wish I had found you sooner.

 

WordPress: remove tooltips from menu links list

WordPress adds a title attribute to text links which is identical to the text of the link itself.

This can mean that when you hover over a text link, a tooltip pops up containing the text from the title attr, obscuring the links on the page. This does not usually look very good, and can obscure subnavigation links in drop down menus, thus reducing usability and causing irritation.

It doesn’t seem to have any positive value – I can’t imagine that it is of any benefit in terms of accessibility, for example. Read More »

 

WordPress: Attached Image Captions add 10px width

WordPress adds 10px width to any “attachment” div which contains an image with a caption, without warning you or giving you any say in the matter.

It’s done in the media.php file.

more help at http://wordpress.org/support/topic/attached-image-captions-adding-10px, including a helpful plugin.