skip to Main Content

I am using the Divi Accordion Module. Divi allows me to select which heading level (1 through 6) the title of each item will be displayed as. However, I want the title of each item to be displayed as paragraph text (i.e. p tag) and not as a heading (i.e. h1, …, h6). Is this possible to do?

enter image description here

4

Answers


  1. There isn’t a default way to do that. Here is a work around using jQuery.

    jQuery('.et_pb_toggle_title').each(function(i, obj) {
        const text = jQuery(this).text();
        jQuery(this).after('<p class="et_pb_toggle_title">'+text+'</p>');
        jQuery(this).remove();
    });
    
    Login or Signup to reply.
  2. I have inserted this Code

    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery('.et_pb_toggle_title').each(function(i, obj) {
        const text = jQuery(this).text();
        jQuery(this).after('<p class="et_pb_toggle_title">'+text+'</p>');
        jQuery(this).remove();
    });
    });
    </script>
    

    Unfortunately, this is not a solution, only optical waste…
    The headline SEO problem remains. Only basic code conversion in the DIVI Theme helps.

    Login or Signup to reply.
  3. The following code works for me (and replace heading by paragraph tag) :

    <script type="text/javascript">
      jQuery(document).ready(function() {
        jQuery('.et_pb_toggle_title').each(function(i, obj) {
          const text = jQuery(this).text();
          jQuery(this).after('<p class="et_pb_toggle_title">'+text+'</p>');
          jQuery(this).remove();
        });
      });
    </script>
    
    Login or Signup to reply.
  4. This code works for me using Divi 4.20. The additional ".no-title" class allows me to be selective in which Toggles/Accordians are affected by the change. You can add the additional class in Toggle Settings > Advanced > CSS ID & Classes > CSS Class.

    <script>
     jQuery(function($) {
      $('.no-title .et_pb_toggle_title').each(function() {
       $(this).replaceWith("<p class='et_pb_toggle_title'>"+$(this).html()+"</p>")
      });
     });
    </script>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search