Nick Morales

Nick Morales TRIJuice.com
Owner / Editor

TRIJuice.com

We had 2 projects on the table that needed attention, upgrade Moveable Type and install the Hybrid News theme/template. Our problem was we did have the time. We searched and found PRO IT Service. After reviewing their services, reviewing their portfolio and some Q&A we hired them to do the task. The result is, we are now up-to-date with MT and we have an updated site that looks GREAT!

Home ›› Blog ›› WooCommerce ›› Customizing "woocommerce_archive_description" HTML structure in WooCommerce (SEO)

Customizing "woocommerce_archive_description" HTML structure in WooCommerce (SEO)

Optimizing WooCommerce Product Category Pages for Search Engines

At the moment I'm under a 4-weeks contract with a Jewelry manufacturer from Central London for optimizing their website.

We've dealt with lots of items that needed to be addressed for their WordPress WooCommerce website project and we've arrived at the point where I am doing some SEO optimization for them.

Their theme uses some templates that are overwriting the WooCommerce default templates, among them being also:
archive_product.php

In this template their previous wordpress developer added two headers, one for the desktop and one for mobile.

Apart from retaining only one of the headings as H1, the one for the desktop, and making the one from the mobile header a regular paragraph with the initial look and feel of the H1, I'm now dealing with the product category description, which is again listed twice, once for the desktop and once for mobile.

I won't insist on the fact that it could have been one single header, made responsive!

In order to change only one of the two occurrences of:

<?php
	if ($bg_image) {
		do_action( 'woocommerce_archive_description' );
	}
?>


Which produces:

<div class="term-description"><p>My customer's product category custom description here.</p></div>


With something to produce:

<h2 class="term-description">My customer's product category custom description here.</h2>


I'm replacing the initial coding listed above with:

<?php
	if ($bg_image) {
		echo '<h2 class="term-description">' . $queried_object->description . '</h2>';
	}
?>

You're welcome to follow this sample on your WooCommerce project or to hire me for any WooCommerce custom development that you might need.

Kind Regards,
Mihai Bocsaru

Post a Comment