Hi,
a while ago, Beda (Toolset support) helped me to construct this function.
on my website this function was working until i tested the same function with the french url (generated by WPML)
function foobar_func( $atts ){
global $wp;
$current_url = home_url(add_query_arg(array(),$wp->request));
return $current_url;
}
add_shortcode( 'foobar', 'foobar_func' );
> I added [foobar] in Third-party shortcode arguments
[wpv-conditional if="( '[foobar]' eq '<em><u>hidden link</u></em>' )"]TEST[/wpv-conditional]
but when i wanted to use the same function with the french url, evrything diseapeard of the website
[wpv-conditional if="( '[foobar]' eq '<em><u>hidden link</u></em>' )"]TEST[/wpv-conditional]
> hidden link
it supposed to show up Above the search bar (in the sidebar) but the text "TEST" does'nt show up
could you help me to fix this
I cannot assist this.
We do provide Custom Code help sometimes, small snippets and tips and tricks, but we cannot start to debug them or expand them, especially when it is not related to Toolset or does not use Toolset features.
What you can try to do is insert just "Foobar" ShortCode, and see what it outputs on each language.
Then you can either adapt the condition or the ShortCode, in case it's conflicting with translated content.
But I suspect the conditional is just not comparing correct values.
So, after seeing what exactly "Foobar" outputs on your French URL, you can compare to this exact value, and then it should work.