- This topic has 11 replies, 2 voices, and was last updated 6 years ago by
Leo.
-
AuthorPosts
-
November 14, 2017 at 6:13 am #423981
Sergei
Hey. I have question about a logo. So, Customize->Layout->Primary Navigation i add a logo. But i can`t find function to make it non clickable. I use my website in 3 languages, my primary language is latvian. When i use russian or english language and click on logo, then my website starts again in latvian language.
Thanks
November 14, 2017 at 8:04 am #424154Leo
StaffCustomer SupportHi there,
In that case we can try using the
generate_inside_navigation
: https://docs.generatepress.com/article/generate_inside_navigation/So try this PHP snippet:
add_action( 'generate_inside_navigation','lh_add_navigation_logo' ); function lh_add_navigation_logo() { ?> <div class="site-logo sticky-logo navigation-logo"> <img class="header-image" src="https://staduplacis.lv/wp-content/uploads/2017/10/Stadu-placis-LOGO-1.png" alt="Staduplacis.lv"> </div> <?php }
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know.
November 14, 2017 at 8:48 am #424189Sergei
When i add this
add_action( 'generate_inside_navigation','lh_add_navigation_logo' ); function lh_add_navigation_logo() { ?> <div class="site-logo sticky-logo navigation-logo"> <img src="https://staduplacis.lv/wp-content/uploads/2017/10/Stadu-placis-LOGO-1.png" alt="Staduplacis.lv" /> </div> <?php }
to my functions.php then i have 2 same logos, one is clickable, second is non clickable. Then i remove my logo from Primary Navigation and after that logo showing in header and big size.
November 14, 2017 at 9:35 am #424233Leo
StaffCustomer SupportThe logo needs to be remove the primary navigation. We are basically rebuilding that feature.
Can you leave the code in so I can see the result and make adjustment?
Thanks.
November 14, 2017 at 11:49 am #424321Sergei
Deleted logo from primary navigation. You can see now how it looks.
November 14, 2017 at 12:10 pm #424336Leo
StaffCustomer SupportTry this CSS:
.main-navigation .navigation-logo { float: left; display: block; margin-left: -10px; -webkit-transition: height .3s ease; -o-transition: height .3s ease; transition: height .3s ease; opacity: 1; } .main-navigation .navigation-logo img { position: relative; vertical-align: middle; padding: 10px; display: block; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-transition: height .3s ease; -o-transition: height .3s ease; transition: height .3s ease; } .main-navigation .navigation-logo img { height: 60px; }
Adding CSS: https://docs.generatepress.com/article/adding-css/
November 14, 2017 at 12:40 pm #424354Sergei
Its work, but not correct position on mobile device. Still better look when it was in primary navigation. Just need to remove link from logo.
November 14, 2017 at 1:08 pm #424368Leo
StaffCustomer SupportQuick question before we continue. Are going to use sticky navigation?
November 14, 2017 at 1:12 pm #424371Sergei
Sticky navigation is disabled.
November 14, 2017 at 1:42 pm #424395Leo
StaffCustomer SupportHey sorry my apology.
Scratch all of the above. This snippet should work:
add_filter( 'generate_navigation_logo_output','lh_change_navigation_logo_output' ); function lh_change_navigation_logo_output( $output ) { return sprintf( '<div class="site-logo sticky-logo navigation-logo"> <img class="header-image" src="%3$s" alt="%4$s" /> </div>', esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ), esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), 'http://staduplacis.lv/wp-content/uploads/2017/10/Stadu-placis-LOGO-1.png', esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ) ); }
November 14, 2017 at 2:16 pm #424408Sergei
Thank you Leo. Working for me, problem resolved.
November 14, 2017 at 6:21 pm #424537Leo
StaffCustomer SupportNo problem.
Thanks for the question 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.