Menu on dark or light backgrounds on specific pages

Multipurpose WordPress Theme Forum Support
GK User
Sun Jun 05, 2016 10:52 pm
Hello,

Based on your Quark Ecommerce demo, on Cart and Checkout pages you have dark menu color in spite the fact you use dark image background stored in Theme customizer (Features tab). How to achieve the same? I have a dark image background selected for most of the pages but need inverted menu and logo color for Cart and Checkout pages.

Thank you
User avatar
Junior Boarder

Joshua M
Mon Jun 06, 2016 8:13 am
Hello,

Could you please provide me with a URL to your website, either here or via PM (click the “Private Message” text underneath my avatar) so that I may analyze it?
User avatar
Moderator

GK User
Thu Jun 23, 2016 9:51 am
Hello Joshua, could you please provide me with the a short guide how to achieve the same settings for your demo. Definitely, you use 'dark image background' in theme settings, but on Cart page and Checkout page you have 'light' background with dark menu. I can't provide you with the link due to security reasons. If you insist, you need to pm with your IP address. Do I need to manually change some hardcoded code in template's files?? Thanks
User avatar
Junior Boarder

Joshua M
Thu Jun 23, 2016 10:44 am
Hello,

Try to edit your Quark/header.php file and change the following line:
Code: Select all
if (is_category() || is_author() || is_singular( array( 'post', 'page' )) )  {


into:
Code: Select all
if (is_category() || is_author() || is_singular( array( 'post', 'page' )) && $wc_condition )  {
User avatar
Moderator

GK User
Thu Jun 23, 2016 11:13 am
Yes, thank you it does work for. One more thing.
When I click on a Feature Page, Search Page, Contact Page in a menu provided from demo I get WHITE logo (image used) and dark menu (which is not right). Blog page works OK (get both white logo and white menu). Again, my settings are: 'Dark image background' ENABLED, 'Dark image background on front page' DISABLED. Any help is much appreciated. Thanks
User avatar
Junior Boarder

GK User
Thu Jun 23, 2016 11:23 am
This happens, when I alter that line you've told me. If leave the mentioned line as it was before, those pages work correctly.
Thanks.
User avatar
Junior Boarder

Joshua M
Fri Jun 24, 2016 8:25 am
Please try to change the entire fragment (condition) to:
Code: Select all
   if (get_theme_mod('quark_dark_image', 1) == 1) {
      $logo_image = get_theme_mod('quark_logo', '');
      if (is_category() || is_author() || is_singular( array( 'post', 'page' )) )  {
         if(is_woocommerce() || is_checkout() || is_cart()) {
            $dark_img = '';
         } else {
            $dark_img = 'dark-bg';
         }
      } else {
         $dark_img = '';
      }
   } else {
      $logo_image = $dark_logo_image;
   }


The search page is treated like cart,checkout, so the logo is always dark, if you want to change it please add is_search conditional tag:

Code: Select all
if (is_category() || is_search() || is_author() || is_singular( array( 'post', 'page' )) )  {
User avatar
Moderator

GK User
Fri Jun 24, 2016 8:45 am
Thank you, Joshua. After showing me the right direction to dig I managed to write an extra condition on my own yesterday the same way you post here except for the search page. Thank you. You probably need to include these settings to the customizer (woocommerce section maybe?) during the next update since these are basic things we need to be able to change in this template. Moreover, your online demo works almost the same way I need to work on my side but from the quick start it doesn't. Please think about it. Again, thank you for your help. Have a great day!
User avatar
Junior Boarder


cron