Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1304354
    jdiaz1302
    Participant

    Hey there, I’ve been trying to use different shortcodes in the topbar, I didn’t give mucho importance until now that I would really love to use icon shortcodes there.

    Is there any setting or workaround to accomplish that?

    #1304355
    Rue Nel
    Moderator

    Hello There,

    Thanks for writing in! By default, the topbar content only accepts text. If you want to insert a shortcode, we need to override the default. Because what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    After the child theme is set up, please add the following code in your child theme’s functions.php file

    // Allow shortcodes in the topbar content
    // =============================================================================
    function allow_custom_shortcodes($contents) {
      $contents = do_shortcode($contents);
      return $contents;
    }
    add_filter('x_option_x_topbar_content', 'allow_custom_shortcodes');
    // =============================================================================

    We would loved to know if this has work for you. Thank you.

  • <script> jQuery(function($){ $("#no-reply-1304354 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>