Site logo

Archived topic

Different menu, logo, link on specific page and category

31 replies · Started by Royal Rangers on October 23, 2020

Viewing posts 1–15 of 32

Hi, how I can set this?
1) I set a header and mobile logo via Elements. How I set a sticky logo for different pages and category?
2) How set different a logo link for different pages and category?
3) How set submenu color on specific pages and category?
4) How set offcanvas menu color on specific pages and category?

Thanks for help.

Hi there,

1) This filter should work:
https://docs.generatepress.com/article/option_generate_menu_plus_settings/#sticky_menu_logo

See some examples here: https://generatepress.com/forums/search/option_generate_menu_plus_settings/

2) Give filter a shot first:
https://docs.generatepress.com/article/generate_logo_href/

3) CSS is required. You can see all the CSS associated with the menu here:
https://docs.generatepress.com/article/changing-navigation-colors/

Then you just need to target the specific pages or categories. For example,
.main-navigation .main-nav ul ul li a
becomes
body.page-id-xxx .main-navigation .main-nav ul ul li a

4) The CSS should be similar to #3. So
.main-navigation .main-nav ul ul li a
becomes
.slideout-navigation.main-navigation .main-nav ul ul li a

Hi thanks for response.
1) Works, but... Sticky logo is main from web when i resize windows. I see both logos too.

add_filter( 'option_generate_menu_plus_settings','ringoturnaj_sticky' );
function ringoturnaj_sticky( $options ) {
    if ( is_page( array(14901,15068,15058,15060,15062,15066,15064,15070,15072,15056,14916,15074,15076) ) || is_category('ringoturnaj') ) {
        $options['sticky_menu_logo'] = 'https://www.mywebsite.cz/wp-content/uploads/2020/Logo-male-bile.png';
        $options['sticky_menu'] = 'true';
    }
    
    return $options;
}

2) Works, but... In specific page and category is ok. On the main web is link on the actual page where I am actually.

add_filter( 'generate_logo_href', function() {
    if ( is_page( array(14901,15068,15058,15060,15062,15066,15064,15070,15072,15056,14916,15074,15076) ) || is_category('ringoturnaj') )
    return "https://www.myweb.cz/ringoturnaj/";
} );

3) Works. I set this via hooks.
4) Works. i set this via hooks.
5) I try change color of site-info via hook on specific pages and category. Doesnť work.

.site-info {
    color: #ffffff;
    background-color: #000000;
}

Can you see on code?

1) Are you still using the old navigation logo option in the customizer?

If so can you remove that first?

2) Not sure if I understand. Can you explain a bit more?

5) Can you try adding CSS using one of these methods instead of hooks?
Adding CSS: https://docs.generatepress.com/article/adding-css/

1) When I delete sticky navigation logo from customizer so sticky logo is displaying on specific pages only. Other pages missing. When I resized windows I see default mobile logo too.
2) Try https://www.royalrangers.cz/blog/. Logo link is on the same page. On specific page which i defined in code works.
5) In customizer works, but I need this on specific page only. I try create hook wp_footer but doesn´t work. Code is viewing as plaintext under classic footer.

Can you first clear and deactivate the caching plugin so I can take a closer look?

Please make sure this is always done when we are trying to help:
https://www.screencast.com/t/LLvPDBka

1) Do you have a navigation logo uploaded in the customizer under Layout > Customizer?

2) What is the code that you've added there?

5) CSS should not be added using a hook. Try one of the methods I provided and target specific pages:

body.page-id-xxx .site-info {
    color: #ffffff;
    background-color: #000000;
}

Please split up your questions to multiple topics next time so it's easier to handle:
https://www.screencast.com/t/DHKUymD43FD

We would really appreciate it if you can try to follow the forum guidelines so it's easier for us to help.

Thanks!

Hi, cache plugin is deactivated.

1) Yes. In customizer I have uploaded default sticky and mobile logo. On specific pages I have uploaded another logo and mobile logo via Elements. Sticky logo for specific pages I set in functions.php

add_filter( 'option_generate_menu_plus_settings','ringoturnaj_sticky' );
function ringoturnaj_sticky( $options ) {
    if ( is_page( array(14901,15068,15058,15060,15062,15066,15064,15070,15072,15056,14916,15074,15076) ) || is_category('ringoturnaj') ) {
        $options['sticky_menu_logo'] = 'https://www.royalrangers.cz/wp-content/uploads/2020/Logo-male-bile.png';
        $options['sticky_menu'] = 'true';
    }
    
    return $options;
}

2) This code:

add_filter( 'generate_logo_href', function() {
    if ( is_page( array(14901,15068,15058,15060,15062,15066,15064,15070,15072,15056,14916,15074,15076) ) || is_category('ringoturnaj') )
    return "https://www.royalrangers.cz/ringoturnaj/";
} );

Maybe i can disable logo link totally.

5) Ok. I think that it works via hooks.

Sorry for inconviences. Next time I split my questions.

Can you provide the dashboard login for me to take a look?

Access granted.

Let's take care of one question at a time.

1) Try adding this CSS:

.page-id-14901 .sticky-navigation-logo {
    display: none !important;
}

It´s works. For every page must I add same code? When I resize windows I see default mobile logo.

Hi, it works. Last problem is with logo link now. Try https://www.royalrangers.cz/blog/. Logo link is on the same page.

On specific pages code works.

add_filter( 'generate_logo_href', function() {
    if ( is_page( array(14901,15068,15058,15060,15062,15066,15064,15070,15072,15056,14916,15074,15076) ) || is_category('ringoturnaj') )
    return "https://www.myweb.cz/ringoturnaj/";
} );

Hi,

You have to add is_home() to your condition.

Example:

add_filter( 'generate_logo_href', function() {
    if ( is_page( array(14901,15068,15058,15060,15062,15066,15064,15070,15072,15056,14916,15074,15076) ) || is_category('ringoturnaj') || is_home() )
    return "https://www.myweb.cz/ringoturnaj/";
} );

Don´t work. Customize logo link I need only on specific page and category.

This archived topic is closed to new replies.