WordPress.org

Forums

WooCommerce - excelling eCommerce
how to disable image links in catalog page (1 post)

  1. editora
    Member
    Posted 1 year ago #

    Hello,

    I'm trying to disable the image links in woocommerce main catalog page, so that it wouldn't be possible to access the single product's detail page.
    The site is: http://omundoculturaenatureza.com.br/?post_type=product

    I've tried to paste this code into the functions, but it affects ONLY the one page I don't wish to be affected, the home.

    /*  code from the page http://wordpress.stackexchange.com/questions/33724/remove-links-from-images-using-functions-php */
    
    add_filter( 'the_content', 'attachment_image_link_remove_filter' );
    
    function attachment_image_link_remove_filter( $content ) {
        $content =
            preg_replace(
                array('{<a(.*?)(wp-att|wp-content\/uploads)[^>]*><img}',
                    '{ wp-image-[0-9]*" /></a>}'),
                array('<img','" />'),
                $content
            );
        return $content;
    }

    How can this be done?

    Thanks, Priscila.

    http://wordpress.org/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic