Site logo

[Support request] Changing Sidebar Widget Title From H2 to H6

Home Forums Support [Support request] Changing Sidebar Widget Title From H2 to H6

Home Forums Support Changing Sidebar Widget Title From H2 to H6

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1321810
    John

    Hello,

    I was wondering which template file I need to edit to change the default “widget-title” on the sidebars to H6 instead of an h2? Any help you can provide would be appreciated – thanks!

    #1321836
    David
    Staff
    Customer Support

    Hi there,

    you can use these two filter hooks to change them:

    https://docs.generatepress.com/article/generate_start_widget_title/
    https://docs.generatepress.com/article/generate_end_widget_title/

    your code would be something like this:

    add_filter( 'generate_start_widget_title', 'widget_title_start_tag' );
    function widget_title_start_tag()
    { 
        return '<h6 class="widget-title">';
    }
    
    add_filter( 'generate_end_widget_title', 'widget_title_end_tag' );
    function widget_title_end_tag()
    { 
        return '</h6>';
    }
    #1321848
    John

    Worked great thank you David!!

    #1321864
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.