• Resolved jbgglgdev

    (@jbgglgdev)


    Hi, is it possible to replace <h4 class="widget-title">Recent Articles</h4> by something like <strong class="widget-title">Recent Articles</strong> so no more h4 ?

    thank you
    JB

Viewing 1 replies (of 1 total)
  • Hi JB,

    It is possible to alter the widget titles. Are you using a child theme? If not, you will need to setup an MU plugin to add the modifications to. We have setup some documentation on setting up an MU plugin on our Github page, found here.

    Once you have your MU plugin setup, you can add the following code to it.

    
    /**
     * Alter widget titles.
     *
     * @author GoDaddy
     *
     * @param  array $widgets Array of theme widgets.
     *
     * @return array
     */
    function strong_widget_titles( $widgets ) {
    
    	foreach ( $widgets as $name => $data ) {
    
    		$widgets[ $name ]['before_title'] = '<strong class="widget-title">';
    		$widgets[ $name ]['after_title']  = '</strong>';
    
    	}
    
    	return $widgets;
    
    }
    add_filter( 'primer_sidebars', 'strong_widget_titles' );
    

    Let us know how that works for you.

    Evan

    • This reply was modified 7 years, 9 months ago by Evan Herman.
    • This reply was modified 7 years, 9 months ago by Evan Herman.
Viewing 1 replies (of 1 total)
  • The topic ‘class=”widget-title”’ is closed to new replies.