Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Damian Góra

    (@damian-gora)

    The issest way is to hide the search conditionally via CSS. Here is PHP snippet you can apply.

    
    add_action( 'wp_head', function () {
      $r = $_SERVER['REQUEST_URI'];
    
      if ( ! empty( $r ) && strpos( $r, '/negozio/' ) !== false ) {
        ?>
        <style>
          .dgwt-wcas-widget {
            display: none;
          }
        </style>
        <?php
      }
    } );
    

    You have two ways to add this code to your theme:

    Open the functions.php in your Child Theme and add the code at the end
    or install the Code Snippets plugin and apply this code as a snippet

    Best
    Damian

    Thread Starter pievedepitti

    (@pievedepitti)

    works perfectly, thanks.
    Because the site has a second language, I’m sure I can duplicate the snippet changing the name of the page, but there is a way to include both pages in the same code so to avoid having two snippets doing the same??
    that’s the ENG url
    https://www.mercatodeivignaioli.it/en/shop/

    Thread Starter pievedepitti

    (@pievedepitti)

    Ok, I wrote a code. Thanks

    Plugin Author Damian Góra

    (@damian-gora)

    Then use it:

    
    add_action( 'wp_head', function () {
      $r = $_SERVER['REQUEST_URI'];
    
      if ( ! empty( $r ) &&
           ( strpos( $r, '/negozio/' ) !== false || strpos( $r, '/en/shop/' ) !== false )
         ) {
        ?>
        <style>
          .dgwt-wcas-widget {
            display: none;
          }
        </style>
        <?php
      }
    } );
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘exclude by URL’ is closed to new replies.