Snippets for various heading tags

You are here:
Estimated reading time: 1 min

For SEO or any reason, you can change some of hardcoded headings tags in Rey by using these code snippets below and pasting them into the child theme’s functions.php .

For others that are not mentioned here, please create a new support ticket and request the code snippet. Or if you have suggestions about their default state, it would be great also to weight in the opinion of an SEO expert.

LinkAccount Panel & Wishlist Popup (Header)

add_filter('rey/header/account_heading_tags', function( $tags ){
	return array_merge($tags, [
		'wishlist'      => 'h5',
		'login'         => 'h5',
		'lost_password' => 'h5',
		'register'      => 'h5',
		'hello_title'   => 'h5',
	]);
});

LinkHeader Wishlist Popup (widget)

add_filter('reycore/elementor/header-wishlist/title_tag', function( $tag ){
	return 'h4';
});

LinkSearch Panel titles

This code snippet will handle the trending keywords title heading tag, as well as the custom quick menus.

add_filter('reycore/header/search_params', function( $params ){
	$params['trending_keywords_tag'] = 'h4';
	$params['menu_title_tag'] = 'h4';
	return $params;
});

LinkShopping Cart panel top titles

add_filter('reycore/header/cart_params', function( $params ){
	$params['title_tag'] = 'h3';
	return $params;
});

LinkProduct title tag in catalog

add_filter('woocommerce_product_loop_title_tag', function( $tag ){
	return 'h2';
});

LinkProduct title tag in product page

This will require to override the wp-content/plugins/woocommerce/templates/single-product/title.php template into the child theme and manually edit the tag, although it’s not recommended at all.

LinkProduct page’s navigation invisible H2

This snippet below will modify the product page’s next previous navigation invisible screen reader text, which is coming from WordPress’ core eg: https://d.pr/i/y8aAaT .

add_filter('navigation_markup_template', function( $template ){
	return str_replace('<h2 class="screen-reader-text">%2$s</h2>', '<div class="screen-reader-text">%2$s</div>', $template);
});

LinkProduct page’s Share title

add_filter('reycore/woocommerce/product_page/share/title_tag', function( $tag ){
	return 'h5';
});

LinkProduct page’s Reviews title

add_filter('reycore/woocommerce/reviews/title_tag', function( $tag ){
	return 'h2';
});

LinkBlog teasers

add_filter('reycore/module/blog-teasers/settings', function( $params ){
	$params['title_tag'] = 'div';
	return $params;
});

Was this article helpful?
Dislike 0
Views: 16

Suggest article improvements

Please use this form to suggest improvements and report missing or outdated content. Support requests will most likely not be answered and it's best to use the Support Request Form instead. Thanks!