June 19, 2014 at 5:57 pm #281285
I have tried to use a shortcode in the small info text, but the shortcode is not interpreted, and is simply displayed as it is.
What I am trying to do is to display a different phone number depending on where the visitor is located. I am using the “Content By Country” plugin in other parts of the website very successfully.
Is there a way to get a shortcode interpreted in the small info text t the top right of the website?
See the top right part of http://www.loyalzoo.com/contact for clarity.
Thanks.June 19, 2014 at 6:26 pm #281296
Please go to Appearance > Editor and open Helper-main-menu.php file and find
$phone = $headerS['header_phone_active'] != "" ? $headerS['phone'] : "";
and change it to
$phone = do_shortcode("[insert shortcode here]");
YigitJune 19, 2014 at 11:25 pm #281438
I have tried, but unfortunately that crashes the site. I think it is because my shortcode has double quotes in them. This is my shortcode:
[CBC country=“us, ca” message=”+44 (0)20 3598 3932″]1 (617) 982 1353[/CBC]
What is the exact string I should use?
Many thanks for your kind help!
Will this modification be overwritten with theme updates?June 19, 2014 at 11:43 pm #281445
Please change the code to following one in that case
$phone = do_shortcode('[insert shortcode here]');
simply single quote instead of double
Edit: Yes it will. You can use a child theme to avoid that. Please see – http://www.kriesi.at/documentation/enfold/using-a-child-theme/
June 20, 2014 at 12:39 am #281466
- This reply was modified 1 year, 3 months ago by Yigit.
Many thanks Yigit, now it seems to work.
Unfortunately the CBC plugin doesn’t work as expected, so I need to figure out one issue with the developer of the plugin.
Many thanks for your great help!
By the way, will this change be overwritten when the theme gets updated?June 20, 2014 at 12:41 am #281468
Yes it will. You can use a child theme to avoid that. Please see – http://www.kriesi.at/documentation/enfold/using-a-child-theme/
You are welcome, we are always glad to help :) Let us know if you have any other questions or issues
The topic ‘Shortcodes in small info text’ is closed to new replies.