By default the widget titles in Genesis have h3
tag like this:
If you would like to change the h3
s to another tag, like a div
s or h4
s, add the following in your child theme’s functions.php:
// Replace h3 with h4 for all widget titles | |
add_filter( 'genesis_register_sidebar_defaults', 'custom_register_sidebar_defaults' ); | |
function custom_register_sidebar_defaults( $defaults ) { | |
$defaults['before_title'] = '<h4 class="widget-title widgettitle">'; | |
$defaults['after_title'] = '</h4>'; | |
return $defaults; | |
} |
After adding the above,
Source: http://ozzyrodriguez.com/tutorials/genesis/changing-widget-title-formatting-genesis/
Want to do this change but only for a specific widget? Here’s one way using jQuery: https://sridharkatakam.com/changing-wordpress-widget-title-heading-tag-using-jquery/
🙁 try it today. doesn’t work.
Can you provide the URL of your site?
Thanks 🙂
Many thanks ! i was seraching how to do that 😉
This works for footer & general widgets , not the home featured widget or CTA ( like on AgentPress Pro theme)
Do you have any suggestion for AgentPress Pro ?
I’d really like to argue that this functionality should be added to core, or at the very least an official plugin to extend widgets. Major selling feature, too…
Possible? In the works?
Hi Sridhar
Thanks for this tuts really works well, I made mine to H1 tag . However it all affects the other widget title on my homepage I just the want to make an h1 just only for the hero area not h1 to all my widget titles how I can make other to be like h4 and h3 and h5 for the widget title