-
AuthorPosts
-
August 21, 2016 at 1:12 am #675130
Hi there,
I recognize that the h1 is linked on pages/posts and I would like to do the same to Woocommerce categories.
Is there any way to achieve this?
Thanks in advance.
August 21, 2016 at 11:21 am #675289Hey gerry3211,
It might not be possible to do this easily but we would like to take a look at this to see if we can help you with it. Would you mind providing a precise link to your site, showing the elements in question? We need to be able to inspect them in order to help :)
Best regards,
VinayAugust 24, 2016 at 6:10 am #676789Hi Vinay,
Thank for the reply.
Sample product category attached.
Would be awesome if the h1 was hyperlinked like it is on posts and pages.
Thanks in advance for any assistance you can offer.
– Gerry
August 26, 2016 at 4:41 pm #678211Hi,
Please add following code to Functions.php file of your child theme in Appearance > Editor
add_filter('avf_title_args', 'fix_product_category_post_title', 10, 2); function fix_product_category_post_title($args,$id,$prod_cat_args) { $cate = get_queried_object(); $cateID = $cate->term_id; if (is_product_category()) { $args['title'] = single_term_title("",false); $args['link'] = get_term_link( $cateID, 'product_cat' ); $args['heading'] = 'h1'; } return $args; }
Best regards,
YigitSeptember 1, 2016 at 11:44 pm #681064Very cool, that did the job.
Just one minor edit…
When you mouse over the H1 Linked Category Title, it reads “Permanent Link: Category Title”
Is there any way to remove the “Permanent Link:” text on mouseover?
Thanks for the awesome work.
September 2, 2016 at 12:50 pm #681260Hi,
Please go to Enfold/functions-enfold.php file and find
if(!empty($link) && !empty($title)) $title = "<a href='".$link."' rel='bookmark' title='".__('Permanent Link:','avia_framework')." ".esc_attr( $title )."' $markup>".$title."</a>";
and change it to
if(!empty($link) && !empty($title)) $title = "<a href='".$link."' rel='bookmark' title='".__('','avia_framework')." ".esc_attr( $title )."' $markup>".$title."</a>";
Best regards,
YigitSeptember 5, 2016 at 3:43 pm #682235Perfect and fixed!
Thanks man, you can close this one.
September 5, 2016 at 3:49 pm #682236 -
AuthorPosts
- The topic ‘Link h1 Title on Woocommerce Category’ is closed to new replies.