Widget logic
-
Hi,
I’m trying to make widgets show based on language using the Widget Logic plugin with no luck. Any ideas? All the logic/syntax I have tried doesn’t seem to work.
I was using the Dynamic Widgets plugin but they have removed support for qTranslate-X 🙁
-
Just add a condition based on the value of function qtrans_getLanguage()in the widget-logic field. Something like:
qtrans_getLanguage() == ‘en’
Hi,
Yes, that is the problem. The condition like that used to work, just for qTranslate-x it was qtranxf_getLanguage()==’en’ … but this unfortunately no longer works and I suspect it’s because Widget Logic has stopped supporting qTranslate-x.
I’m hoping there is a workaround… as I’m not sure what else to do?I confirm that it does work. I am currently using it on a live website under WP 4.8. The right syntax actually is: qtrans_getLanguage()==”en”
Don’t forget to check the “compatibility functions” in the “integration” tab of your qTranslate-x settings, or the qtrans_getLanguage() function might not be recognised.
I do not think that widget-logic makes any difference whatsoever between qTranslate-x functions and other functions.
That said, there are problems with the translation of the title and content of widgets since the WP 4.8 upgrade, but it is another story.
Hi,
Ok, got it to work. I had another widget plugin that was interfering with the logic.
Thanks for the help! 🙂-
This reply was modified 7 years, 10 months ago by
MagineM.
@b_machuel: I had the same problems with widget Title and Content after the Update to 4.8 (did a rollback).
Do you know if there is a thread in here somewhere, or a solution, a workaround?I have not found anything yet on that issue and I am too busy until the end of this month to spend any time on it. Should I eventually find a solution, I will be happy to share it with you.
A very simple solution is Widget Logic. This plugin allows to set conditions to the display of a widget. You just need to put a condition on the qtrans_getLanguage() function in the Widget-Logic field and the widget will display only for the language selected. But that means you need to create several instances of the same widget (one per language).
-
This reply was modified 7 years, 10 months ago by
- The topic ‘Widget logic’ is closed to new replies.