1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved How can I add/embed html code to header elements?

Discussion in 'Free Divi Community Forum' started by Odhiambo, Aug 16, 2024.

  1. Odhiambo

    Odhiambo New Member

    Hola everyone.

    How can I embed html code to the header elements in the areas marked in the attached photo?
    My website is https://kictanet.or.ke. I'd like to add HTML code given by Google translator plugin to the top of the page instead of having a floating widget,

    Thank you in advance.
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Block Pro - Easy-to-use drag & drop interface to mix & match 456+ premade Divi blocks & export as json file:Learn More
  2. Divi Booster

    Divi Booster Divi Expert

    Hey Odhiambo,

    This post describes how to add text / html to the top bar (item 1 in your screenshot):

    https://divibooster.com/how-to-add-text-to-divi-top-header/

    Item 2 and 3 are trickier. Probably the best way to achieve what you want would be to recreate your header (both the top bar and main header bar) using the Divi Theme Builder (WP Admin > Divi > Theme Builder). The theme builder lets you use a full Divi builder layout for the header and so you can lay things out how you want them (with sections, rows, and columns) and use code modules to add your Google Translator html. For the social icons you can use the social media follow module, and for the menu / logo you can use a menu module.
     
  3. Odhiambo

    Odhiambo New Member

    So I have Divi Booster v3.8.5.
    The code I wanted to add is:
    ```
    <?php echo do_shortcode('[google-translator]'); ?>
    ```

    Is that allowed?
    I added that in the box, but seems like it does nothing! Check the site - https://www.kictanet.or.ke/

    Here is a screenshot of what I did.
     

    Attached Files:

    1. PRO MEMBER PERKS Divi Login Customizer Plugin - Instantly beautify your Wordpress login page with 6 premade designs:Learn More
  4. Divi Booster

    Divi Booster Divi Expert

    That code is PHP code, which isn't allowed. But you don't need to use the PHP code to process the shortcode - the top header text feature can handle shortcodes. So you should just be able to just directly enter the shortcode into the setting, i.e.:

    Code:
    Log In or Sign Up to view this code.
    Note that there was an improvement to shortcode handling in the top header text released in Divi Booster v4.0.2, so if it doesn't work correctly, try updating Divi Booster (the current version is v4.6.1) and see if that helps.

    Give me a shout if you need any further help with it. Thanks!
     
  5. Odhiambo

    Odhiambo New Member

    That worked. Thank you very much.
     
    1. PRO MEMBER PERKS Divi Ultimate Archive Plugin - Tons of elegant premade sidebar styles to choose from for your Divi site:Learn More
  6. Divi Booster

    Divi Booster Divi Expert

    Great! Thanks for letting me know, Odhiambo :)