Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1220833

    Hi,

    We’re trying to change the header tags of the “categories” and “latest news” in our blog sidebar from <h3> to anything else. We also want to change the font size of all h3 elements from 30px to 28px.

    We’re currently using the enfold child them, I tried altering the PHP theme code below but with no luck:

    register_sidebar(array(
    ‘name’ => ‘Forum’,
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget clearfix %2$s”>’,
    ‘after_widget’ => ‘<span class=”seperator extralight-border”></span></div>’,
    ‘before_title’ => ‘<h3 class=”widgettitle”>’,
    ‘after_title’ => ‘</h3>’,
    ‘id’ => ‘av_forum’
    ));

    For the font size change, couldn’t find the relevant CSS selectors either.

    #1220857

    i guess you can follow this answer here:
    https://kriesi.at/support/topic/change-h3-tags-in-footer-widget-child-theme-of-enfold/#post-727939 and from Yigit here:
    https://kriesi.at/support/topic/change-h3-tags-in-footer-widget-child-theme-of-enfold/#post-728320

    On register-widget-area.php you find the names and ID’s of the widget areas. I cannot see a Forum Widget Area – but you will know that on your installation. ( i let it on section instead of your div – then all would be the same syntax – if you like change section to div)
    The normal blog widget is called: Sidebar Blog with id: av_blog
    for child-theme functions.php:

    function ava_remove_some_widgets(){
    	unregister_sidebar( 'av_forum' );
    
    	register_sidebar(array(
    		'name' => 'Forum',
    		'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">',
    		'after_widget' => '<span class="seperator extralight-border"></span></section>',
    		'before_title' => '<h4 class="widgettitle">',
    		'after_title' => '</h4>',
    		'id'=>'av_forum'
    	));
    }
    add_action( 'widgets_init', 'ava_remove_some_widgets', 11 );

    For the font size change, couldn’t find the relevant CSS selectors either.

    For advice, I would have to see the page it concerns.

    _____________________
    Off Topic
    as long as the headings should be all the same tag i would take this code instead of Yigits – a little bit shorter:
    for child-theme functions.php:

    function register_custom_footer_widget(){   
        $footer_columns = avia_get_option( 'footer_columns', '5' );
        for ($i = 1; $i <= $footer_columns; $i++){
        unregister_sidebar( 'av_footer_'.$i );
    
        register_sidebar(array(
          'name' => 'Footer - column'.$i,
          'before_widget' => '<section id="%1$s" class="widget clearfix %2$s">', 
          'after_widget' => '<span class="seperator extralight-border"></span></section>', 
          'before_title' => '<h5 class="widgettitle">', 
          'after_title' => '</h5>', 
          'id'=>'av_footer_'.$i
        ));
      } 
    }
    add_action( 'widgets_init', 'register_custom_footer_widget', 11 );
    #1220867

    Hey,

    1- Please add following code to bottom of functions.php file to update widget title tags (H4 in example)

    function av_widget_title_tag( $params ) {
        $params[0]['before_title'] = '<h4 class="widgettitle">' ;
        $params[0]['after_title']  = '</h4>' ;
        return $params;
    
    }
    add_filter( 'dynamic_sidebar_params' , 'av_widget_title_tag' );

    2- To edit widget title font sizes, please go to Enfold theme options > Advanced Styling and edit “Widget title” :)


    @guenni007
    Thanks for your help El Supremo! :)

    Best regards,
    Yigit

    #1220871

    hi Yigit – You can’t joke around here anymore either. I was just surprised to be called “Sir”.

    Btw.: this code above changes all widget titles to h4 even the footer ones?
    i thought he would only change these specific heading tags.

    #1222096

    Hi,


    @Guenni007
    You are right. @menainfosec please refer to Guenni’s post :)

    Best regards,
    Yigit

    #1222099

    Thanks for the support, we’ve resolved the issue

    #1222293

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Changing h3 html tags in enfold child’ is closed to new replies.