By using Elementorforum.com’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Unofficial Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!
elementor official

Question How to change Sidebar Widget Title Heading Tag?

D

dirk1

New Member
Hi,
I am using Elementor with the Astra template and want to change the title heading tag from H2 to H4 in widgets loading in Elementor sidebars. For Astra sidebars I have been able to change it from H2 to H4 as described in the Astra help page.
But for the sidebar loaded by Elementor this does not apply. Somehow Elementor is defining the heading title still as H2.
How can I change the title heading tag to H4 for widgets loaded by the Elementor sidebar?
Thanks for any help
Dirk
 
elementor official
sms-design

sms-design

Member
If you looking to control font size give your sidebar widget a css class from the advanced tab

like: dirk1-widget-sidebar and add this to your custom css

.dirk1-widget-sidebar .widget-title {
font-size: 14px;
color: #fff;
text-decoration: underline;
margin-bottom: 4px;
background-color: red;
width: 25%;
border-radius: 6px;
padding: 5px 0;
}

Change above values to suit
 
elementor official
D

dirk1

New Member
No. I would like to change the tags from H2 to H4.

Do you know where this defined for Elementor sidebars?
 
elementor official
sms-design

sms-design

Member
Without changing core files you can run a script

$('.sideMenu h3').replaceWith(function () {
return "<h2>" + $(this).html() + "</h2>";
});

This is a solution provided on Stack Overflow
 
elementor official
D

dirk1

New Member
ok.
I am trying to add the script to the theme functions.php but get the error:

syntax error, unexpected '(', expecting variable (T_VARIABLE) or '{' or '$'

Could you give me a hint how to add it to the functions.php correctly?
 
elementor official

Latest posts

Other Elementor Resources

elementor official
elementor official
Top