How do I change heading from H2 to H3 with custom css?

Issue

I am using this google maps plugin that doesn’t allow you to change style of title of the map. Developers told me to change it with custom CSS.

Since I am a beginner, I don’t know how to do that since I don’t have id of the element, just the class.

This is the line that when I change from h2 to h3 does what I want it to do, but that’s only in inspector. I need to apply this permanently.

<h2 class="widgettitle">Marinas and tours</h2>

And then the only widgettitle I could find in plugin files was the following code, and after changing it from h2 to h3, it does absolutely nothing:

  // initialize widgets
  static function widgets_init() {
    $options = GMWP::get_options();

    register_widget('GoogleMapsWidget');

    if (!$options['disable_sidebar']) {
      register_sidebar( array(
        'name' => __('Google Maps Widget PRO hidden sidebar', 'google-maps-widget'),
        'id' => 'google-maps-widget-hidden',
        'description' => __('Widgets in this area will never be shown anywhere in the theme. Area only helps you to build maps that are displayed with shortcodes.', 'google-maps-widget'),
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget'  => '</li>',
        'before_title'  => '<h2 class="widgettitle">',
        'after_title'   => '</h2>',
      ));
    } // if activated
  } // widgets_init

Solution

I fixed this by looking for "widgettitle" in my website files with notepad++. There was a php file containing widget title defaults and I changed them from h2 to h3.

    Line 271:       'before_title'   => '<h2 class="widgettitle">',
Line 1168:  *                                 Default `<h2 class="widgettitle">`.
Line 1197:      'before_title'  => '<h2 class="widgettitle">',

Answered By – deeresther

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published