• I’m working with and trying give option that users can hide slider from any selected page types like, Posts pages, Woocommerce pages, or front pages

    currently i’m using css display:none; which is not right way because slider images still loads which is more load on site just display none.
    here is my code

    if( is_home() || is_front_page() ){	if (get_theme_mod('hide_sliderfront')=='1'){ echo '.orbit-container{display:none;}';}}
        if( is_page() ){ if (get_theme_mod('hide_sliderpages')=='1'){ echo '.orbit-container{display:none;}';}}
        if( is_single() ){ if (get_theme_mod('hide_sliderpost')=='1'){ echo '.orbit-container{display:none;}';}}
        if( is_woocommerce() || is_shop() || is_product_category() || is_product() || is_cart() || is_checkout() || is_account_page() || is_product_tag() ){	if (get_theme_mod('hide_sliderwoo')=='1'){ echo '.orbit-container{display:none;}';}}

    I just want how to use this code in PHP using condition. bcoz i’m confused

  • The topic ‘How to add condition for Front page or any selected page’ is closed to new replies.