Day 32 – 2011

by | Oct 13, 2011 | 2011 | 0 comments

Creative trouble shooting today! I have been trying to get the pretty links working on a wordpress site which has been giving me no end of grief.  The normal permalink changes have been absolutely fine, it is the language ones using qtranslate that have been giving me the problem. 

The site is going to be a bi-lingual site for our local primary school as it is a bi-lingual school I have added welsh to the site.  All was well and good with “?lang=cy” in the URL but not very Search Engine helpful so I wanted site/cy/post_name to be format of the links.  Every time I tried to make the change I got a 404 error.

I have deleted and reinstalled the qtranslate plugin, changed the theme, disabled all other plugins, adding new posts after the setting change was made – all with no success.  I have another wordpress site in  a dual language setup which does not have this problem, so I started comparing the differences in the settings of the two sites, and the only difference was that the 2 letter country code was in capitals, so I made the change and it worked once I had edited a post and reentered the welsh title and post content.

I then tried setting it back to lower case and it chucked out the 404 error again.  So reset the language code back to the capitals, and with two quick mysql queries:

update wp_posts set post_content=replace(post_content,'<!–:cy–>’,'<!–:CY–>’);

update wp_posts set post_title=replace(post_title,'<!–:cy–>’,'<!–:CY–>’);

we were back in business!

Don’t ask me the why of it….I only know it is now doing what I want it to.  So now it’s time to re-enable the disabled plugins and I can start working on the theme again!  Well themes actually, as I want to be able to have multiple themes based on what section of the site you are on, eg in the parents area a nice adult type theme, but in the kids area a theme more suited to primary school pupils.

Watch this space….