WPML compatibility
Hi,
Roots theme gives problems with the combination of WPML. I've tested this on the latest WP (v3.3.1) and WPML (v2.4.3).
The problem
The filters of roots_root_relative_url() don't handle the url's to the tags as they should, it seems. This also impacts plugins like Yoast's SEO plugin, resulting in incorrect URL's in sitemaps.
E.g:
The tag URL's in a French (secondary language) post, generated by get_the_tags_list():
- Expected result: absolute URL: http://site/blog/fr/tag/some-tag/ (or) relative URL: /blog/fr/tag/some-tag/)
- Roots Result: /blog/tag/some-tag/
The language, /fr/ , is missing.
Suggestions
My temporary solution(s) is one of the following 3 suggestions:
-
Disable the relative url settings in the Theme Options. Enable Root Relative URLs - No
-
Comment following lines in roots/inc/roots-cleanup.php For older roots versions:
add_filter('the_tags', 'roots_root_relative_url');
add_filter('tag_link', 'roots_root_relative_url');
Latest roots version: Comment in $the_tags array (around line 70)
'the_tags',
'tag_link',
- Change the roots_root_relative_url() function. Replacing site_url() by home_url("/") seems to fix the tags urls. It keeps them relative and correct, but it might break other things. I didn't test this enough.
The first suggestion is the safest, but it would be great if there as a stable patch for this so relative url's can still be used.
Kind regards, Coati
I'm also a WPML user, and I have encountered these issues also.
thanks for the issue - number three sounds like a nice fix, will do some testing to see how it affects everything
thx a lot! this should be fixed now.
Hi retlehs, glad it worked. Looks stable to me too so far. Thank you for the theme!
Adding an option to enable/disable relative urls would be nice instead of having to edit cleanup.php. This is especially useful with CDN, which require absolute urls to function properly.
I would love to see an option for this too. I had to write some custom functions in my plugin to re-create the URLs since we need the full URL to source images to generate thumbnails.