[Resolved] Mobile Menu and Mobile Header Color for Different Page

Home Forums Support [Resolved] Mobile Menu and Mobile Header Color for Different Page

Home Forums Support Mobile Menu and Mobile Header Color for Different Page

  • This topic has 45 replies, 3 voices, and was last updated 6 years ago by Tom.
Viewing 15 posts - 1 through 15 (of 46 total)
  • Author
    Posts
  • #495794
    elsa

    Hi,
    How to set different color for specific page of mobile menu and mobile header color. Thanks.

    #495836
    Leo
    Staff
    Customer Support

    Hi there,

    Can you guide me to the page you are referring to so I can give you the code?

    Let me know.

    #495842
    elsa
    #496073
    Leo
    Staff
    Customer Support

    Actually I’m not sure the how many colors you want to change but all the menu CSS are here: https://docs.generatepress.com/article/changing-navigation-colors/

    You just have to wrap it with media query so it’s mobile only:
    https://docs.generatepress.com/article/responsive-display/#responsive-breakpoints

    As for page specific, if you use Tom’s Simple CSS plugin, it gives you a CSS metabox each page so the CSS in there are page specific.

    #496647
    elsa

    Hi Leo,
    Which CSS Plugin is it?

    #496832
    Leo
    Staff
    Customer Support
    #499359
    elsa

    Hi Leo,
    Thanks for your help, it’s working! What about product category page, I can’t seem to edit the style with CSS plugin. How to enable it in category archive page?

    #499563
    Leo
    Staff
    Customer Support

    Yeah those are index pages (blog, archive) so metabox won’t work.

    If you are wanting all category pages to, then add .category in front of the selector, like this for example:

    .category .main-navigation .main-nav ul li a, 
    .category .main-navigation .menu-toggle {
    	color: #FFFFFF;
    }
    #499899
    elsa

    Hi Leo,
    How to select particular category page such as category “KIDS” only? Thanks.

    #499911
    Leo
    Staff
    Customer Support

    Try .category-kids

    #499915
    elsa

    Would you help me to give conditional tag for this, as this for several categories? thanks.

    #499941
    elsa

    Never mind, I’ve found a way. Thanks!

    #500007
    elsa

    Hi Leo,
    Turns out I can’t resolve this. So I add this snippet but didn’t work. How to make it right?

    function mytheme_styles_scripts() {

    if ( is_page( ‘Kids’ ) || is_product_category( ‘Kids’ ) || has_term (‘kids’, ‘product_cat’))
    {
    wp_enqueue_style( ‘kids’, get_template_directory_uri() .’/Custom Junita/Kids.css’,false,null,’all’);
    }
    }

    //hook the function to wp_enqueue_scripts action hook
    add_action( ‘wp_enqueue_scripts’, ‘mytheme_styles_scripts’ );

    #500263
    Leo
    Staff
    Customer Support

    Hmm you don’t need the snippet to change the mobile menu and mobile header color on category pages.

    #500844
    elsa

    Hi Leo,
    The different page will be more than 200 pages out of 400. So if I insert CSS one by one, it will be lots of hassle. Please help to resolve this. Here’s my code.

    function mytheme_styles_scripts() {

    wp_register_style( ‘kids’, trailingslashit( get_stylesheet_directory_uri() ).’kids.css’,__FILE__);
    }

    if ( is_page( ‘Kids’ ) || is_product_category( ‘Kids’ ) || has_term (‘kids’, ‘product_cat’)) {
    wp_enqueue_style( ‘kids’);
    }
    //hook the function to wp_enqueue_scripts action hook
    add_action( ‘wp_enqueue_scripts’, ‘mytheme_styles_scripts’ );

Viewing 15 posts - 1 through 15 (of 46 total)
  • You must be logged in to reply to this topic.