WordPress debug mode and xml-rpc problems

This post is about using xml-rpc to post in WordPress. If you experience problems of this type:

32700:parse error. not well formed


32300:transport error - HTTP status code was not 200

It can be many things, but we have been crazy checking all the configuration until we realised that the problem was coming from the fact that the WordPress installation had the WP_DEBUG flag set to TRUE

define('WP_DEBUG', 'true');

And you should change it to FALSE

Deactivate WordPress plugins that don’t let you load wp-admin page, from database

It has always been a problem, that WordPress will stop loading the admin panel if there are problems generated by the plugins.

If you have access to the database, you can fix the broken WordPress admin panel by running this query:

SELECT * FROM wp_options WHERE option_name = 'active_plugins';

And removing what you obtain in the field:


Thanks to Perishable Press for their detailed explanation:


Custom thumbnail sizes in WordPress: tips and hints to master them

I am working on a new WordPress theme and have identified several issues with the thumbnails.

Some initial clarifications:

When you use the function to get the thumbnail from a post, what you will be getting is the featured image.

Initially WordPress comes with pre-defined sizes by default:

the_post_thumbnail('thumbnail');       // Thumbnail (default 150px x 150px max)
the_post_thumbnail('medium');          // Medium resolution (default 300px x 300px max)
the_post_thumbnail('large');           // Large resolution (default 640px x 640px max)
the_post_thumbnail('full');            // Original image resolution (unmodified)

 source: http://codex.wordpress.org/Post_Thumbnails

You can define custom sizes and names for new types of thumbnails. 

But you will have to regenerate the thumbnails in order to have the new images created, in case you would like to use the “crop” parameter, that is, that the image created will not be a resize, but rather taking the content from the center of the existing full-size image. 

This is explained pretty well here: http://codex.wordpress.org/Function_Reference/add_image_size

What is not explained in the Codex documentation is that the crop option will not work unless you regenerate the thumbnails. How do you regenerate the thumbnails?

There are several alternatives that I am aware of:

1. Delete permanently and upload the image again

2. Use the regenerate thumbnail plugin: http://wordpress.org/plugins/regenerate-thumbnails/

3. With PHP code, doing something like this:

include( ABSPATH . ‘wp-admin/includes/image.php’ );
wp_generate_attachment_metadata( $thumbnail_id, $absolute_path_to_image );

following this: 


A discussion on this can also be found here http://wordpress.stackexchange.com/questions/35833/the-post-thumbnail-hard-cropping-not-working-no-matter-what/128032#128032

How to make a language switcher menu in PHP

this snippet will work if you have a structure like this

(English pages)




(Spanish pages)




This is the code you can put in a menu as a list item. It would work nicely in a wordpress website.

<? if (substr($_SERVER[“REQUEST_URI”],1,2) == “es”) { ?>
<li><a href=”/<? echo substr($_SERVER[“REQUEST_URI”],4); ?>”>In English</a></li>
<? } else { ?>
<li><a href=”/es<? echo $_SERVER[“REQUEST_URI”]; ?>”>En español</a></li>
<? } ?>

Yoast SEO problem with the News: Notice: Undefined index: wpseo_sitemaps

I was currently using All-in-one-SEO in my blog, but looking for a solution to send also sitemap to Google News I cam across with Yoast SEO plugin, which is great, but I found this bug when trying to configure 

News SEO for WordPress & Google – Yoast

The problem was:

Notice: Undefined index: wpseo_sitemaps

It breaks your blog installation

This is caused when you have unticked the option to generate the XML sitemap. I had to uninstall the files, so the plugins were no longer recognized and had to reconfigure it.


Remove the annoying “blog” slug attached to the main site in a wordpress multisite 3.5

This worked well in a wp multisite 3.5 environment

1. At blog site set Settings -> Permalinks -> Common Setting -> Default (Must select default only and don’t touch any thing, If you need to change category base, tag base set at Network Admin only)

2. At Network Admin -> Sites -> (root site) Permalink Sturcture -> /%category%/%post_id% (this is an example, put here whatever you want, for example if you prefer “/%postname%/ just put it”

That it will remove /blog slug


thanks to metoo55 in http://wordpress.org/support/topic/why-wp-multisite-force-blog-slug-how-to-remove-it