Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1362132

    How do I do this to h4 or h5

    #1362148

    Hey daves1997,

    Thank you for the inquiry.

    Are you referring to the widget title in the sidebar area? The following css code should adjust the style of the title (h3 element).

    #top .widget h3.widgettitle {
        background-color: transparent;
        color: red !important;
    }

    Please toggle or temporarily disable the Enfold > Performance > File Compression settings while editing the site.

    Best regards,
    Ismael

    #1362160

    everywhere or only in the footer?

    #1362170

    I want All widget titles to be h4 or h5.

    #1362179

    one easy way is to substitut them by jQuery in your child-theme functions.php.
    Some fellow members here on board think that this has no influence on the SEO Analysis (that they will stay to read them as h3) of the site. However, many of the BOTs – including the Google Bot – are reading more and more of the content of a page after all the loading processes have been completed.

    function replace_tags_with_tags(){
    ?>
    <script>
      (function($) {       
          function replaceElementTag(targetSelector, newTagString) {
            $(targetSelector).each(function(){
              var newElem = $(newTagString, {html: $(this).html()});
              $.each(this.attributes, function() {
                newElem.attr(this.name, this.value);
              });
              $(this).replaceWith(newElem);
            });
          }
          replaceElementTag('h3.widgettitle', '<h4></h4>'); 
      }(jQuery)); 
    </script>
    <?php
    }
    add_action('wp_footer', 'replace_tags_with_tags');
    #1362197

    i think that the call of the widget init in parent theme functions.php:
    require_once( 'includes/admin/register-widget-area.php' );
    can not be replaced by a child theme analog file.

    #1362198

    Looks Like it works. You are right about google

    #1362200

    but if you like to give this a chance – for child-theme functions.php:
    ( the dummy widgets are not influenced on that – due to snippet length ;) )

    function ava_re_register_widgets(){
    	
    	unregister_sidebar('av_everywhere');
    	register_sidebar( array(
    		'name'			=> 'Displayed Everywhere',
    		'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_everywhere'
    	));
    
    	unregister_sidebar('av_blog');
    	register_sidebar( array(
    		'name'			=> 'Sidebar Blog',
    		'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_blog'
    	));
    	
    	unregister_sidebar('av_pages');
    	register_sidebar( array(
    		'name'			=> 'Sidebar Pages',
    		'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_pages'
    	));
    	
    	if( class_exists( 'WooCommerce' ) ){
    		unregister_sidebar('av_shop_overview');
    		register_sidebar( array(
    			'name'			=> 'Shop Overview Page',
    			'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_shop_overview'
    		));
    
    		unregister_sidebar('av_shop_single');
    		register_sidebar( array(
    			'name'		=> 'Single Product Pages',
    			'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_shop_single'
    		));
    	};	
    
    	if( avia_get_option( 'archive_sidebar' ) == 'archive_sidebar_separate' ){
    		unregister_sidebar('av_archives');
    		register_sidebar( array(
    			'name'		=> 'Sidebar Archives',
    			'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_archives'
    		));
    	};
    	
    	$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'  => '<h4 class="widgettitle">',
    		  'after_title'   => '</h4>',
    		  'id'            => 'av_footer_' . $i
    		));
    	}
    }
    add_action( 'widgets_init', 'ava_re_register_widgets', 11 );

    so with that you can decide what tag the widget areas will have on the widget-titles
    PS : the if clauses with woocommerce and archiv_sidebar i have not tested

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Change H4 tag widget title’ is closed to new replies.