Ad

How Can I Remove The Category Description From The Nav Item's Title Attribute

- 1 answer

I am currently working on the site https://barwareandmore.com.au,

If you click on any item from the left hand nav bar, then hover your mouse over another item, you can see that the link's title attribute contains that category's description.

This code is also reflected in the source code for all pages (thus making duplicate content)

Is there a way i can remove the title attribute from these links? or set them to be the value of nothing?

i am using the DaVinci Theme

Sorry i can't be more specific, still a rookie at wordpress,

Thanks for any help/advice/suggestions :]

Ad

Answer

I did download the theme, and had a look at it.

Go to your theme files, look for cat-menu.php inside products folder i believe, afiles, look for cat-menu.php inside products folder i believe, and look for this:

$product_cat_menu = wp_list_categories( array(
'taxonomy' => 'product_cat',
'show_count' => 1,
'hide_empty' => 1,
'echo'=> 0,
'title_li' => sprintf('<h3>%s</h3>', __('Categories', 'ami3')),
'link_before' => '<span class="main-el-icon"></span>'
) );

And add to it 'use_desc_for_title' => 0, which basically tells the query to not include the description in the title. So finally it will be :

$product_cat_menu = wp_list_categories( array(
'taxonomy' => 'product_cat',
'show_count' => 1,
'hide_empty' => 1,
'echo'=> 0,
'title_li' => sprintf('<h3>%s</h3>', __('Categories', 'ami3')),
'link_before' => '<span class="main-el-icon"></span>',
'use_desc_for_title' => 0
) );
Ad
source: stackoverflow.com
Ad