Services widget headings size (from h3 to h2)

Hi, I’m using Sydney free.
When using a services widget (both type A and type B) I have realized that both the title and the description of the title are h3, this is causing issues when using screen readers for disable (blind) people, as they need to recognize the title with h2 and the description below with h3.

Is it possible to change the tag of the title from h3 to h2, or the description from h3 to h4?? and adjust the font size afterwards to make it more aesthetic??

thanks!

Hi,

Please post a link to your website, to the page where you have added a services widget, so I can give you a working solution for this.

Best Regards,
Csaba

This is the main page, where I’ve used the widget for type B:
http://www.fderechoydiscapacidad.es/

and this is the sub-page where I have used the type A
http://www.fderechoydiscapacidad.es/fundacion/

Thanks!!

Hi,

You can change the heading tags of the widget-titles in functions.php, line 96-97, in this code:

'before_title'  => '<h3 class="widget-title">',
		'after_title'   => '</h3>',

Modify the h3 opening and closing tag to h2.

then apply this Custom CSS to make it the same size as it was before:

h2.widget-title {
    font-size: 32px !important;
}

Please add the above CSS to your Child Theme’s style.css or in case you haven’t setup a Child Theme already, then you can also use this plugin to add the CSS to it: https://wordpress.org/plugins/simple-custom-css/ so you will not loose the changes on theme updates.

Please let me know how it works.

Best Regards,
Csaba

Hi Csaba,
thanks for your quick response! Unfortunately I haven’t been able to change it. This is the extract of the functions.php I have modified following your instructions, in the “register widget area” with no success (I tried in both places where tag h3 is mentioned). Is this the correct place, or did I miss anything?

  • Register widget area.

  • @link http://codex.wordpress.org/Function_Reference/register_sidebar
    */
    function sydney_widgets_init() {
    register_sidebar( array(
    ‘name’ => __( ‘Sidebar’, ‘sydney’ ),
    ‘id’ => ‘sidebar-1’,
    ‘description’ => ‘’,
    ‘before_widget’ => ‘<aside id="%1$s" class=“widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h3 class=“widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );

    //Footer widget areas
    $widget_areas = get_theme_mod(‘footer_widget_areas’, ‘3’);
    for ($i=1; $i<=$widget_areas; $i++) {
    register_sidebar( array(
    ‘name’ => __( 'Footer ', ‘sydney’ ) . $i,
    ‘id’ => ‘footer-’ . $i,
    ‘description’ => ‘’,
    ‘before_widget’ => ‘<aside id="%1$s" class=“widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h3 class=“widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );
    }

Hi,

Have you been able to modify the files and changed both star and end h3 tags in the code:

‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,

?

Please make sure you have done that correctly, because that have to be the area where h3 tag have to changed, also make sure to clear your cache after the modification.

Best Regards,
Csaba

Hi Csaba,
I have reviewed and it’s done as you explained:

  • Modify functions.php
  • Section “Register widget area”
  • Function "Sydney_widget_init()

I have changed before_title and after_title from h3 to h2, cleared cache and it’s still the same… I have tried accessing from other computers to ensure cache is cleared, but nothing.

am I missing some other changes?

thanks for your support!

Hi,

I’ve checked and that’s the only place to modify it in the theme, so that means if that doesn’t change then it’s set in SiteOrigin’s Page Builder and yes it is, so you have to modify the Page Builder Plugin’s siteorigin-panels.php file on line 1275:

$before_title = '<h3 class="widget-title">';
		$after_title = '</h3>';

and in settings folder / settings.php, line 120:

$defaults['title-html'] = '<h3 class="widget-title">{{title}}</h3>';

Please let me know how it works.

Best Regards,
Csaba