Mar 03

In the past, the majority of WordPress themes would enclose the title of sidebar widgets within an HTML h3 heading tag. The Thesis Theme V1 is one such theme.

WordPress theme designers have moved away from this practice because of an increased awareness of SEO. Nowadays, people who write search engine optimised content generally use HTML heading tags exclusively for hierarchical text elements with relevant contextual keywords designed to appeal to search engines, e.g. a post title with the main target keyword would be enclosed within h1, then the subheadings with additional keywords would be enclosed within h2, and so on.

In contrast, WordPress widgets often have generic titles like ‘categories’, ‘tags’, ‘meta’ and ‘links’ which have offer no usefulness as search keywords. Having h3 on these is wasteful as it has the potential to take value away other relevant keywords on the page.

The Thesis theme does not have a hook to change the styling of widget/sidebar titles. The solution is to unregister the two default sidebars, then re-register them with a different html markup for the title. In this example, h3 has been replaced by a div with the class “widgettitle”.

Furthermore, we have to ensure that this only happens AFTER the Thesis Theme has finished its default sidebar registration. This is achieved by hooking the action ‘widgets_init’ with a priority of 11 – lower than the WordPress default priority of 10.

The following code snippet should be added to custom_functions.php in the Thesis Theme’s custom file editor:

function replace_sidebar_headers()
{
	unregister_sidebar('sidebar-1');
	unregister_sidebar('sidebar-2');

	register_sidebar(
                array(
                        'name' => 'Sidebar 1',
                        'id' => 'sidebar-1',
                        'before_widget' => '<li class="widget %2$s" id="%1$s">',
                        'after_widget' => '</li>',
                        'before_title' => '<div class="widgettitle">',
                        'after_title' => '</div>'
                )
        );

	register_sidebar(
                array(
                        'name' => 'Sidebar 2',
                        'id' => 'sidebar-2',
                        'before_widget' => '<li class="widget %2$s" id="%1$s">',
                        'after_widget' => '</li>',
                        'before_title' => '<div class="widgettitle">',
                        'after_title' => '</div>'
                )
        );
}

add_action('widgets_init', 'replace_sidebar_headers', 11);
 

Tags: ,

Add Your Comments

css.php
  • https://faire-revenir-son-ex.com/sitemap.txt
  • https://everestgliders.com/sitemap.txt
  • https://behroo165.com/sitemap.txt
  • https://afftray.com/sitemap.txt
  • https://newsify.press/sitemap.txt
  • https://2bfoot.com/sitemap.txt
  • https://pantryz.com/sitemap.txt
  • https://nextgendataguru.com/sitemap.txt
  • https://wnewstv.com/sitemap.txt
  • http://i-park.org/sitemap.txt
  • https://10xtravel.com/sitemap.txt
  • https://edebiyatist.com/sitemap.txt
  • https://ytiyonkers.org/sitemap.txt
  • https://healthynights.co/sitemap.txt
  • https://3dmodely.ru/sitemap.txt
  • https://499football.com/sitemap.txt
  • https://admselenga.ru/sitemap.txt
  • https://ambia.ru/sitemap.txt
  • https://arteninaoltu.com/sitemap.txt
  • https://artislogistics.pro/sitemap.txt
  • https://artmama-mouse.ru/sitemap.txt
  • https://audit-research-center.com/sitemap.txt
  • https://avtoznak.ru/sitemap.txt
  • https://baikal-sera.ru/sitemap.txt
  • https://bethazor.com/sitemap.txt
  • https://bio7septic.ru/sitemap.txt
  • https://biotique-shop.ru/sitemap.txt
  • https://biserstav.ru/sitemap.txt
  • https://blowcamp.com/sitemap.txt
  • https://burger1.rest/sitemap.txt
  • http://wpsecure.be
  • http://wpskill.com
  • https://wpua.cloud
  • http://wresidencescostarica.com
  • https://wsportals.com
  • https://wssrradio.com
  • https://ws-start.ru
  • https://wyomingadvocates.com
  • http://wzonez.com
  • https://xanahosting.com
  • https://xcitercalls.com
  • https://xelbookings.com
  • https://xenvious.com
  • https://ximenamargain.com
  • http://xn--12cc2eo0ezb5as.com
  • http://xn--42cgaan6dxdxace0c1dg8cs4cu3n9fdh.com
  • http://xn--82cz5bqv8f.com
  • http://xn--thringen-verzaubert-69b.de
  • https://xrsw.uk
  • https://xsytikaa.com
  • https://yamaguchi-sokkyo.or.jp
  • https://yaminpublishing.com
  • https://yashhomes.ca
  • http://yellbitcoin.com
  • http://yestrading.net
  • https://yeungmarineholdings.com
  • https://yilsezklima.com
  • https://ymaa.pl
  • https://ymaaeurope.com
  • https://yogaineverydaylife.com
  • https://yogaworlds.in
  • http://yosoy.esy.es
  • http://youcalltheshots.net
  • https://youlooklovely.co
  • http://youlooklovely.photography
  • http://younkakura.com
  • https://yourroadstosuccess.com
  • https://youthfulandageless.com
  • https://yoyoriyu.com
  • https://ytiyonkers.org
  • https://yukomexico.com
  • https://yulehit.com
  • http://yusufyarar.com
  • http://yvonnevandermeer.nl
  • https://zabumutua.com
  • http://zakerhaghighi.ir
  • https://zakynthos2019.nl
  • https://zamacon.es
  • https://zbudujdom.net
  • https://zebiam.com