{"id":2186,"date":"2021-06-02T10:35:44","date_gmt":"2021-06-02T02:35:44","guid":{"rendered":"https:\/\/www.intelliwolf.com\/?p=2186"},"modified":"2021-06-02T10:35:47","modified_gmt":"2021-06-02T02:35:47","slug":"change-divi-footer-widget-title-heading-levels","status":"publish","type":"post","link":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/change-divi-footer-widget-title-heading-levels\/","title":{"rendered":"How To Change Footer Widget Title Heading Levels In Divi"},"content":{"rendered":"\n

For accessibility reasons, I needed to change the heading levels in the WordPress Divi footer widget titles on one of the sites I'm building.<\/p>\n\n\n\n

They are set to <h4> by default, but I needed them to be <h2>.<\/p>\n\n\n\n

The code to change the heading levels is:<\/p>\n\n\n\n

add_action ('widgets_init', 'iw_modify_footer', 100);\n\nfunction iw_modify_footer() {\n  global $wp_registered_sidebars;\n  $before = \"<h2 class='widgettitle'>\";\n  $after = \"<\/h2>\";\n\n  $wp_registered_sidebars['sidebar-2']['before_title'] = $before;\n  $wp_registered_sidebars['sidebar-3']['before_title'] = $before;\n  $wp_registered_sidebars['sidebar-4']['before_title'] = $before;\n  $wp_registered_sidebars['sidebar-5']['before_title'] = $before;\n  $wp_registered_sidebars['sidebar-6']['before_title'] = $before;\n\n  $wp_registered_sidebars['sidebar-2']['after_title'] = $after;\n  $wp_registered_sidebars['sidebar-3']['after_title'] = $after;\n  $wp_registered_sidebars['sidebar-4']['after_title'] = $after;\n  $wp_registered_sidebars['sidebar-5']['after_title'] = $after;\r\n  $wp_registered_sidebars['sidebar-6']['after_title'] = $after;\r\n\n  return true;\n}<\/code><\/pre>\n\n\n\n

How This Works<\/h2>\n\n\n\n

Divi's setup for widget titles is hooked into widgets_init<\/em> as it should be.<\/p>\n\n\n\n

The 100 priority is so that this function fires after Divi has registered the footers.<\/p>\n\n\n\n

I know the naming is a little weird, but the widget blocks that you access through Appearance -> Widgets<\/em> are called \"sidebars\" by WordPress.<\/p>\n\n\n\n

We call the global $wp_registered_sidebars<\/em>, which returns an array of the widget blocks, with their individual details in an array under each.<\/p>\n\n\n\n

Divi's footer widgets are sidebar-2 to sidebar-6. If you're only using three footer widgets, there's no need to do all of them.<\/p>\n\n\n\n

We change the before_title<\/em> and after_title<\/em> settings for each of the widget blocks.<\/p>\n\n\n\n

Because we're changing a global, there's no need to return anything.<\/p>\n\n\n\n

Just make sure you update the styling using something like #main-footer h2.widgettitle {}<\/em> as it will look different now.<\/p>\n","protected":false},"excerpt":{"rendered":"

For accessibility reasons, I needed to change the heading levels in the WordPress Divi footer widget titles on one of the sites I’m building. They are set to <h4> by default, but I needed them to be <h2>. The code to change the heading levels is: How This Works Divi’s setup for widget titles is<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[17,16],"yoast_head":"\nHow To Change Footer Widget Title Heading Levels In Divi<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Change Footer Widget Title Heading Levels In Divi\" \/>\n<meta property=\"og:description\" content=\"For accessibility reasons, I needed to change the heading levels in the WordPress Divi footer widget titles on one of the sites I'm building. They are set to <h4> by default, but I needed them to be <h2>. The code to change the heading levels is: How This Works Divi's setup for widget titles is\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/\" \/>\n<meta property=\"og:site_name\" content=\"Intelliwolf\" \/>\n<meta property=\"article:published_time\" content=\"2021-06-02T02:35:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-02T02:35:47+00:00\" \/>\n<meta name=\"author\" content=\"Mike Haydon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mike Haydon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/\"},\"author\":{\"name\":\"Mike Haydon\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\"},\"headline\":\"How To Change Footer Widget Title Heading Levels In Divi\",\"datePublished\":\"2021-06-02T02:35:44+00:00\",\"dateModified\":\"2021-06-02T02:35:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/\"},\"wordCount\":204,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"keywords\":[\"accessibility\",\"Divi\"],\"articleSection\":[\"Theme Customization\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/\",\"url\":\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/\",\"name\":\"How To Change Footer Widget Title Heading Levels In Divi\",\"isPartOf\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#website\"},\"datePublished\":\"2021-06-02T02:35:44+00:00\",\"dateModified\":\"2021-06-02T02:35:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.intelliwolf.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Theme Customization\",\"item\":\"https:\/\/www.intelliwolf.com\/category\/theme-customization\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How To Change Footer Widget Title Heading Levels In Divi\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.intelliwolf.com\/#website\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"name\":\"Intelliwolf\",\"description\":\"WordPress, Web Design and Coding Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.intelliwolf.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.intelliwolf.com\/#organization\",\"name\":\"Intelliwolf\",\"url\":\"https:\/\/www.intelliwolf.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"contentUrl\":\"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png\",\"width\":300,\"height\":100,\"caption\":\"Intelliwolf\"},\"image\":{\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343\",\"name\":\"Mike Haydon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g\",\"caption\":\"Mike Haydon\"},\"sameAs\":[\"https:\/\/intelliwolf.com\/about-mike-haydon\/\"]}]}<\/script>\n","yoast_head_json":{"title":"How To Change Footer Widget Title Heading Levels In Divi","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/","og_locale":"en_US","og_type":"article","og_title":"How To Change Footer Widget Title Heading Levels In Divi","og_description":"For accessibility reasons, I needed to change the heading levels in the WordPress Divi footer widget titles on one of the sites I'm building. They are set to <h4> by default, but I needed them to be <h2>. The code to change the heading levels is: How This Works Divi's setup for widget titles is","og_url":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/","og_site_name":"Intelliwolf","article_published_time":"2021-06-02T02:35:44+00:00","article_modified_time":"2021-06-02T02:35:47+00:00","author":"Mike Haydon","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mike Haydon","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#article","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/"},"author":{"name":"Mike Haydon","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343"},"headline":"How To Change Footer Widget Title Heading Levels In Divi","datePublished":"2021-06-02T02:35:44+00:00","dateModified":"2021-06-02T02:35:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/"},"wordCount":204,"commentCount":3,"publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"keywords":["accessibility","Divi"],"articleSection":["Theme Customization"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/","url":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/","name":"How To Change Footer Widget Title Heading Levels In Divi","isPartOf":{"@id":"https:\/\/www.intelliwolf.com\/#website"},"datePublished":"2021-06-02T02:35:44+00:00","dateModified":"2021-06-02T02:35:47+00:00","breadcrumb":{"@id":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.intelliwolf.com\/change-divi-footer-widget-title-heading-levels\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.intelliwolf.com\/"},{"@type":"ListItem","position":2,"name":"Theme Customization","item":"https:\/\/www.intelliwolf.com\/category\/theme-customization\/"},{"@type":"ListItem","position":3,"name":"How To Change Footer Widget Title Heading Levels In Divi"}]},{"@type":"WebSite","@id":"https:\/\/www.intelliwolf.com\/#website","url":"https:\/\/www.intelliwolf.com\/","name":"Intelliwolf","description":"WordPress, Web Design and Coding Tutorials","publisher":{"@id":"https:\/\/www.intelliwolf.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.intelliwolf.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.intelliwolf.com\/#organization","name":"Intelliwolf","url":"https:\/\/www.intelliwolf.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/","url":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","contentUrl":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-content\/uploads\/intelliwolf-logo-300t.png","width":300,"height":100,"caption":"Intelliwolf"},"image":{"@id":"https:\/\/www.intelliwolf.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/7209e3ff14822e4d70d5f194a310f343","name":"Mike Haydon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.intelliwolf.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d5f4754fae310a04dede91d15e57c8a0?s=96&d=mm&r=g","caption":"Mike Haydon"},"sameAs":["https:\/\/intelliwolf.com\/about-mike-haydon\/"]}]}},"_links":{"self":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/2186"}],"collection":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/comments?post=2186"}],"version-history":[{"count":2,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/2186\/revisions"}],"predecessor-version":[{"id":2193,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/posts\/2186\/revisions\/2193"}],"wp:attachment":[{"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/media?parent=2186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/categories?post=2186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wordpress-757293-2559390.cloudwaysapps.com\/wp-json\/wp\/v2\/tags?post=2186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}