Black Friday Sale! Get $20 off GP Premium, $40 off our new Lifetime license, and 45% off license renewals/extensions! Learn more

[Resolved] Disable link to products but keep styling

Home Forums Support Disable link to products but keep styling

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #343088
    Jamal

    Hi

    I would like to disable link to products while keeping the theme styling regarding font-sizes color etc. Below is code i’m using and the css that works on developer tools but not in my stylesheet, can anyone help? Thanks

    //Disable Link to Products @ Loop
    remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
    
    /* Style woocommerce product titles after disabling link to products */
    product h2.woocommerce-loop-product__title {
        font-size: 30px !important;
        padding: .5em 0 !important;
    }
    
    

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #343092
    David
    Staff
    Customer Support

    Looks to me like your missing a ‘.’ before product

    #343094
    Jamal

    Thanks David but that doesn’t fix it either. Actually below is the selector i should use but i added “product” to see if i needed to make it more specific.

    h2.woocommerce-loop-product__title

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #343096
    David
    Staff
    Customer Support

    Hi Jamal – is it the CSS that is not working?
    I tried on one my sites and the php worked and so did the CSS with the amended selector.

    #343098
    Jamal

    You are right David, its working but i was making a rookie mistake. I had some “broken” css above it which was causing it not to work. Thanks !

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #343101
    David
    Staff
    Customer Support

    Glad to hear it and glad i could be of assistance lol
    Fortunately i’m a complete rookie – so since Tom pointed this out to me, i commonly test all css at the top of the stack. I notice you post a lot regarding woo. I feel like i have been studying it since i started and i still cant get my head around all of its structure. Currently stuck on creating short-code to display price on product page in a different position…… hoping to nail it tonight!

    #343297
    Jamal

    You are not a complete rookie David 🙂 Yeah i post about WooCommerce lately mostly because it’s a new toy for me to play with haha. But seriously i’m just learning how to tinker with it so when the need arises i can create awesome stuff with GP.

    I’m actually also trying to move the price but on the category page, there are hooks for the single product which you might be interested in.

    Agressively support the kind of work you want to see. Buy it. Talk about it. Review it.

    #343328
    David
    Staff
    Customer Support

    Thanks Jamal it all helps! ill let you know how i get on.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.