Skip to content
GeneratePress
  • Home
  • Premium
  • Site Library
  • Pricing
  • Help
    • Documentation
    • Support Forum
    • Contact
  • Log In

[Resolved] Logo

Log In Free Support

Home › Forums › Support › [Resolved] Logo

Popular Articles

Missing style.css

Updating errors

Installing GP Premium

Installing GeneratePress

How to add CSS

How to add PHP

Home › Forums › Support › Logo

  • This topic has 11 replies, 2 voices, and was last updated 4 years, 6 months ago by Leo.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • 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

    GP Premium 1.5.2
    November 14, 2017 at 8:04 am #424154
    Leo
    Staff
    Customer Support

    Hi 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.

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/

    November 14, 2017 at 8:48 am #424189
    Sergei

    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 #424233
    Leo
    Staff
    Customer Support

    The 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.

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/

    November 14, 2017 at 11:49 am #424321
    Sergei

    Deleted logo from primary navigation. You can see now how it looks.

    November 14, 2017 at 12:10 pm #424336
    Leo
    Staff
    Customer Support

    Try 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/

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/

    November 14, 2017 at 12:40 pm #424354
    Sergei

    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 #424368
    Leo
    Staff
    Customer Support

    Quick question before we continue. Are going to use sticky navigation?

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/

    November 14, 2017 at 1:12 pm #424371
    Sergei

    Sticky navigation is disabled.

    November 14, 2017 at 1:42 pm #424395
    Leo
    Staff
    Customer Support

    Hey 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' ) ) )
    	);
    }

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/

    November 14, 2017 at 2:16 pm #424408
    Sergei

    Thank you Leo. Working for me, problem resolved.

    November 14, 2017 at 6:21 pm #424537
    Leo
    Staff
    Customer Support

    No problem.

    Thanks for the question 🙂

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Log In

Start building better websites today.

Go Premium Documentation

GeneratePress

  • About
  • Premium
  • Site Library
  • Gutenberg
  • Affiliates
  • Brand Assets
  • Blog
  • We’re Hiring!

Support

  • Documentation
  • Contact Us
  • Support Forums
  • Fastest WordPress Theme
  • Changelogs
  • Legal
  • Donate
  • Translate

Articles

  • Install GeneratePress
  • Installing GP Premium
  • Missing style.css
  • Plugin Install Failed
  • Adding CSS
  • Adding PHP
  • WordPress Hosting

© 2022 EDGE22 Studios LTD.

  • Home
  • Premium
  • Site Library
  • Pricing
  • Contact
  • Support Forum
  • Documentation
  • Account
  • Checkout