- This topic has 4 replies, 2 voices, and was last updated 7 years, 10 months ago by discoman.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
December 2, 2016 at 7:07 pm #104390discomanParticipant
Dear team,
In my online casino site, I wish to change all the widget titles from H2 to h4.
In which file can I change sidbar and footer wiget titles from H2 to h4?
Sidbar sample:
<section id="image-3" class="widget widget_image"> <div class="widget-wrap"> <h2 class="widget-title">SIDEBAR WIDGET NAME</h2> ...
Footer sample”
<section id="text-2" class="widget widget_text"> <div class="widget-wrap"> <h2 class="widget-title">FOOTER WIDGET NAME</h2> ...
Btw, I really respect Matt Cutts, but I prefer to demote these titles to h4.
Thanks, Offir
December 3, 2016 at 4:43 pm #104443PratikParticipantHI @discoman,
For this, you need to make modifications via child theme. Please make a child theme first. The instructions are here: http://catchthemes.com/blog/create-child-theme-wordpress/
After this, please let me know and I will provide you with functions.
Regards,
PratikDecember 3, 2016 at 5:26 pm #104447discomanParticipantHi Patrik,
Child theme createdDecember 4, 2016 at 9:52 am #104492PratikParticipantOk not please try adding following function in your child theme’s functions.php file.
/** * Function to update sidebars */ function clean_magazine_child_update_sidebars() { unregister_sidebar( 'primary-sidebar' ); unregister_sidebar( 'header-right' ); unregister_sidebar( 'footer-1' ); unregister_sidebar( 'footer-2' ); unregister_sidebar( 'footer-3' ); //Primary Sidebar register_sidebar( array( 'name' => __( 'Primary Sidebar', 'clean-magazine' ), 'id' => 'primary-sidebar', 'before_widget' => '<section id="%1$s" class="widget %2$s"><div class="widget-wrap">', 'after_widget' => '</div><!-- .widget-wrap --></section><!-- #widget-default-search -->', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', 'description' => __( 'This is the primary sidebar if you are using a two column site layout option.', 'clean-magazine' ), ) ); //Header Right register_sidebar( array( 'name' => __( 'Header Right', 'clean-magazine' ), 'id' => 'header-right', 'before_widget' => '<section id="%1$s" class="widget %2$s"><div class="widget-wrap">', 'after_widget' => '</div><!-- .widget-wrap --></section><!-- #widget-default-search -->', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', 'description' => __( 'This is the header right widget area. It typically appears on the right of the site title or logo. This widget area is not equipped to display any widget, and works best with a search form, social icons widget, Advertisement Widget or possibly a text widget.', 'clean-magazine' ), ) ); for( $i=1; $i <= 3; $i++ ) { register_sidebar( array( 'name' => sprintf( __( 'Footer Area %d', 'clean-magazine' ), $i ), 'id' => sprintf( 'footer-%d', $i ), 'before_widget' => '<section id="%1$s" class="widget %2$s"><div class="widget-wrap">', 'after_widget' => '</div><!-- .widget-wrap --></section><!-- #widget-default-search -->', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>', 'description' => sprintf( __( 'Footer %d widget area.', 'clean-magazine' ), $i ), ) ); } } add_action( 'widgets_init', 'clean_magazine_child_update_sidebars', 11 );
December 4, 2016 at 4:06 pm #104506discomanParticipantHi,
Working. thank you very much.
Offir
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- The topic ‘Change widget titles from H2 to h4’ is closed to new replies.