Salim, your code looks good. And it tests OK in my installation of WP 4.2.2
Verify the square brackets and insert_php tags are balanced.
If still no joy, there may be a plugin you’re using that converts the code into printable code or, perhaps, doesn’t play nice with Insert PHP and keeps it from running. WP overlays/managers might also prevent the PHP code from running, VisualComposer for example.
Suggest temporarily deactivating all other plugins to see if Insert PHP can then work. If yes, reactivate one at a time to determine which is causing the issue.
If it is another plugin (or an overlay/manager) that’s preventing Insert PHP from working, then a decision will need to be made which is more important to use.
Will
Thread Starter
Salim7
(@salim7)
Hi,
thanks for your quick answer. I have some fears regarding the potential side effect linked to plugin deactivations. I have tried a few plugins but did not identify any improvement. Meantimes, I found a workaround using another plugin.
Thanks!
Salim – what was your other option? I`m having the same problem here. Please advice.
Thread Starter
Salim7
(@salim7)
Hi,
I discover that the “Enhanced Text Widget” plugin was able to run PHP code 🙂 So I used that one instead.
KR
Salim