Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #281285

    Hi,

    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.

    #281296

    Hey loyalzoo!

    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]");  

    Best regards,
    Yigit

    #281438

    Thanks Yigit.
    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!

    P.S.
    Will this modification be overwritten with theme updates?

    #281445

    Hey!

    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://kriesi.at/documentation/enfold/using-a-child-theme/

    Best regards,
    Yigit

    • This reply was modified 10 years, 5 months ago by Yigit.
    #281466

    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?

    #281468

    Hi!

    Yes it will. You can use a child theme to avoid that. Please see – http://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

    Regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Shortcodes in small info text’ is closed to new replies.