1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, 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 I'm seeing a duplicate ID (et-boc) when Divi Ultimate Header Plugin is activated.

Discussion in 'Basic Support Forum' started by Gary Gordon, Aug 30, 2021.

  1. Gary Gordon

    Gary Gordon Member
    Pro Member

    I'm seeing a duplicate ID (et-boc) when Divi Ultimate Header Plugin is activated.

    See: https://wpbns.com

    This is the line (in the source code) where I see the duplicate:

    </header><div id="et-boc" class="et-boc"><div class="free-du-plugin-header et-l"><div class="et_pb_section et_pb_section_9 free-desktop-padding-top-zero et_pb_equal_columns et_section_specialty" >

    The main Divi theme has the following in the source code:
    <div class="entry-content">
    <div id="et-boc" class="et-boc">

    So the code added by the Divi Ultimate Header Plugin is adding the duplicate.
    </header><div id="et-boc" class="et-boc"><div class="free-du-plugin-header et-l"><div class="et_pb_section et_pb_section_9 free-desktop-padding-top-zero et_pb_equal_columns et_section_specialty" >

    Since it is not recommended to have two ID's on the same page that are identical, I'm curious if and how this can be resolved?

    Please let me know.

    Thank you,
    Gary Gordon

    NOTES: I am using the Divi Ultimate Header Plugin v 3.1.0 and the Divi Ultimate Theme v8.1.0. And I'm using Divi v4.10.5 and WordPress v5.8.
     
    #1 Gary Gordon, Aug 30, 2021
    Last edited: Aug 30, 2021
    1. PRO MEMBER PERKS Divi Ultimate Header Plugin - Add custom vertical navigation for your Divi site. Turns into slide in menu on mobile:Learn More
  2. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    We have to add the said ID because on CPT pages, Divi automatically apply the said ID on all the generated CSS for injected layout.

    If we did not add the duplicated CSS ID div tag, it will not render the injected header styling. Thus, this is the only way we can do to avoid that from happening.
     
  3. Gary Gordon

    Gary Gordon Member
    Pro Member

    Well, a duplicate ID on a webpage is not good Isn't it possible to make this a CLASS instead of an ID if you need to use the same name of et-bot? Or, if that doesn't work, can't you re-write the requirements to use a different ID tag, such as et-bot-ex or something else that would be appropriate? See this: https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute I'd really appreciate it if you would look for another solution so we can avoid having any duplicate IDs. Please let me know what other options you can come up with? Please let me know. - Gary
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade testimonial carousel design for your Divi site without using any plugins:View Demo
  4. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    Here's an example of what I meant. On CPT pages, if you set a text module text color to be purple, then Divi will generate the below CSS on your live site:

    <style id="et-builder-module-design-348753-cached-inline-styles">.et-db #et-boc .et-l .et_pb_text_0_tb_header.et_pb_text{color:#8300E9!important}</style>

    But for our header, it's not wrapped in the #et-boc CSS ID tag. And so it will not apply the CSS on CPT pages. Thus, we have no choice but to wrap the #et-boc CSS ID div tag for our header design.
     
  5. Gary Gordon

    Gary Gordon Member
    Pro Member

    What application, plugin, etc., is writing this code?

    <style id="et-builder-module-design-348753-cached-inline-styles">.et-db #et-boc .et-l .et_pb_text_0_tb_header.et_pb_text{color:#8300E9!important}</style>

    I see you're already including the class="et-boc" . Can't you just include both the .et-boc and .et-db ? (Instead of id=et-boc and class=et-boc) Could this work?

    We just need to somehow remove the id="et-boc" I hope you agree that this is not good and doesn't pass html validators.

    Gary
     
    1. PRO MEMBER PERKS Divi.Help Pro Layout Packs - Modern & powerful Agency Divi layout pack, featuring team carousel, sliding menu, etc.View Demo
  6. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    As mentioned, it's Divi theme itself generated the code. It's out of our control.

    But we will try look into implementing the id on CPT pages only, as it only affects the CPT pages. Thus, it may solve the issue on normal pages.
     
  7. Gary Gordon

    Gary Gordon Member
    Pro Member

    Thanks. That will help. But I'm still not understanding why you need to include id=et-boc and that you can instead use class="et-db" like this:

    Since you're saying Divi adds this code to CPT pages:

    <style id="et-builder-module-design-348753-cached-inline-styles">.et-db #et-boc .et-l .et_pb_text_0_tb_header.et_pb_text{color:#8300E9!important}</style>

    Instead of your plugn adding:

    <div id="et-boc" class="et-boc"><div class="free-du-plugin-header et-l"><div class="et_pb_section et_pb_section_9 free-desktop-padding-top-zero et_pb_equal_columns et_section_specialty" >

    can you instead use::

    <div class="et-boc et-db"><div class="free-du-plugin-header et-l"><div class="et_pb_section et_pb_section_9 free-desktop-padding-top-zero et_pb_equal_columns et_section_specialty" >

    If this can't work, then if you can implement it only on pages using CPT, that would help. But please let me know.

    Gary
     
    1. PRO MEMBER PERKS Divi Ultimate Archive Plugin - Tons of elegant premade sidebar styles to choose from for your Divi site:Learn More
  8. Divi.Help Pro Support

    Divi.Help Pro Support Administrator
    Staff Member

    As per the CSS, we will need a wrapper with CSS ID et-boc.

    Just uploaded a new version with the said conditional statement. Since you're on v3.1.0 for the header plugin, you can now update our plugin through the Wordpress dashboard. If you can't see the update in Wordpress dashboard, then try to click: WP Admin > Plugins > Divi Ultimate Header Plugin > Check for updates.

    upload_2021-8-31_16-57-15.png

    Let me know how it goes.
     
  9. Gary Gordon

    Gary Gordon Member
    Pro Member

    I need to say, first ... I'm thrilled that you finally re-did things so the theme and plugins will auto-update within WordPress. This is totally awesome. Second, I really appreciate your help with this, and quick assistance. Again, totally awesome. Thank you very much.
     
    Divi.Help Pro Support likes this.
    1. PRO MEMBER PERKS Divi Block Pro - Premade gallery carousel design for your Divi site without using any plugins:View Demo