Tag Info

New answers tagged

0

I'm not sure how you're planning to deal with these terms, but I think you can still use WPML native way to handle terms translations, even though you can't keep the same slug. When you need to deal with a term slug, you can rely on the icl_object_id() function. For instance, suppose you have English as default language, and Italian as a second language. ...


0

I found that it required removing 4 filters/actions to undo WPML's home_url modification. Since I didn't know what else this might break, I ended up changing my site's logo to use site_url() which in my case was the same, but not changed by WPML. function disable_things(){ remove_filter( 'page_link', array( $this, 'permalink_filter' ), 1, 2 ); ...


0

What about taking a different approach? Keep the filter and in WPML -> Languages, chose "Use directory for default language". There you can specify a static file or create a "Root page". This page won't be connected to any language. It won't even show the language switcher (unless you use a custom template and play with the code).


1

Because you are hardcoding the link, you will need to use icl_link_to_element() function and wrap any text you want to translate inside a gettext function: <?php icl_link_to_element( 'ID_of_your_news_page', 'page', '<h4>' . __('News') . '</h4>' ); ?> This way you will get the correct version of the link based on the current language with ...



Top 50 recent answers are included