What im trying to achieve is remove menu from shop page and product categories pages so it wont load stuff that is not needed, like menu images and stuff…

CSS is not an option here since like mentioned i dont wanna get images loaded.

As if statement i was trying this: if (! is_shop() && ! is_product_category()) {

this is menu calling code/template:

<?php

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

$static_image = (bool)( YIT_Layout()->static_image == 'yes' || get_header_image() != '' );
$opened = 'yes' == yit_get_option('header-cat-dropdow-opened') && ( $static_image || ! in_array( YIT_Layout()->slider_name, array( '', 'none' ) ) ) ? true : false;
$can_close_class ='';
if ( $opened ) {
    add_action( 'yit_slider_append', 'yit_shop_by_category_nav_wrapper_start' );
    add_action( 'yit_slider_append', 'yit_shop_by_category_nav' );
    add_action( 'yit_slider_append', 'yit_shop_by_category_nav_wrapper_end' );

if (yit_get_option('header-cat-dropdow-opened-can-close') == 'yes' ) {
$can_close_class = 'can-close';
    }
}
?>

<div class="shop-by-category border-line-2 nav vertical<?php if ( $opened ) echo ' opened '.$can_close_class ?>">
    <a href="#" class="list-trigger"><?php echo yit_get_option('header-shop-cat-title') ?><span class="sbToggle"></span></a>
    <?php if ( ! $opened ) yit_shop_by_category_nav(); ?>
</div>

thank you all for your answers 🙂

Read more here: How To Remove Menu on Certain Pages and Product Categories – WooCommerce?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: