Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #675289

    Hey 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,
    Vinay

    #676789

    Hi 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

    #678211

    Hi,

    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,
    Yigit

    #681064

    Very 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.

    #681260

    Hi,

    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,
    Yigit

    #682235

    Perfect and fixed!

    Thanks man, you can close this one.

    #682236

    Hey!

    You are welcome, glad i could help :)
    Let us know if you have any other questions or issues!

    Regards,
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Link h1 Title on Woocommerce Category’ is closed to new replies.