[Plugin: WP Subdomains] Category name being dropped from post title link

My category is named ‘javascript’. I have a few posts with ‘javascript’ in the title, but my most recent one is having trouble. The word ‘javascript’ is getting dropped from the href and WordPress does not know where to find the content. If I type the ‘javascript’ back in manually, WordPress knows where to find it.

Seems like the plugin was matching ‘javascript/’ and replacing it with nothing. I could manually write a new permalink so it would not read ‘javascript/’, but I didn’t want to have to do that, so I dug a little deeper.

The rewriting is handled in this file:
‘plugins/wordpress-subdomains/plugin/classes.php’

Around line 475 there is the getCategoryPath() method of the WpsSubDomainCat class. That prepares search and replace strings for another function to use for . . . searching and replacing.

There are two if statements. The first prepares search strings. The second prepares replacement strings. I converted the first if statement to prepare a string with forward slashes at the beginning and end (would match ‘/javascript/’). I converted the second if statement to prepare a string that would simply be a forward slash or a string that ended in one (would insert ‘/’).

This worked great for permalinks that had the category name at the beginning or end of a slug.

I have no way of testing it in all situations, so I don’t know if it breaks anything, but I’m able to navigate around my own site just fine (http://www.dconstructing.com)

If you want the actual code that I used, feel free to contact me and I’d be happy to share.

i was wondering if you could help me with the basic configuration for WP Subdomains plug in. I already have one subdomain that’s active runs as a separate blog. I.E., my main blog is goingintoreprint.com and the subdomain is goingintoreprint.com/photo – Now in the new category I’ve created, I’ve listed “photo” as the category slug. This doesn’t seem to work. When I click on that category name on my main blog page, i get the message that it’s a broken link.
I’d really appreciate any help.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: WP Subdomains] Category name being dropped from post title link’ is closed to new replies.