Support » Theme: GeneratePress » Mobile menu customization

  • Resolved root09

    (@root09)


    hello.

    can i customize mobile menu whithout plugin ?
    like this … [Menu | logo | Phone | Search]
    mobile menu

    thank you 🙂

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter root09

    (@root09)

    ok… i made some “test”…
    it seem that is working:
    Source: https://generatepress.com/forums/topic/site-title-in-navigation-bar/

    CSS:

    @media only screen and (max-width: 850px) {      
        .main-navigation .site-logo{
        float: right;
        line-height: 20px; /* Adjust this to your menu item height */
        margin-right: 5.5em;
        margin-top: 10px;
            
    } 

    PHP:

    
    <?php
        /* 
         * generatepress logo mobile
    	 * Source: https://generatepress.com/forums/topic/how-to-create-a-menu-bar-with-logo/
         */  
    add_action('generate_inside_navigation','generate_navigation_logo');
    function generate_navigation_logo()
    {
    ?>
    	<div class="site-logo mobile-image">
    		<a href="tel:0102030405"><img src="phone image here" alt="mobile"></a>
    	</div>
    	<div class="site-logo mobile-image">
    		<a href="link to home"><img src="logo here" alt="logo"></a>
    	</div>
    <?php
    }
    ?>
    

    two classes, “site logo” and “mobile-image”
    RESULT:
    the result here…

    tell me, if that correct ?

    re… thank you 😉

    Leo

    (@leohsiang)

    Hi there,

    You are on the right track 🙂

    I think this hook would work better though as it will only show up on mobile:
    https://docs.generatepress.com/article/generate_inside_mobile_menu_bar/

    Let me know if you need more info 🙂

    Thread Starter root09

    (@root09)

    hi Leo…
    thank’s for the “tip” 🙂

    
    <?php
        /* 
         * generatepress logo mobile
    	 * Source: https://generatepress.com/forums/topic/how-to-create-a-menu-bar-with-logo/
         */  
    add_action('generate_inside_mobile_menu_bar','generate_navigation_logo');
    function generate_navigation_logo()
    {
    ?>
    	<div class="site-logo">
    		<a href="tel:0102030405"><img src="phone image" alt="mobile"></a>
    	</div>
    	<div class="site-logo">
    		<a href="https://auto.cazes.info"><img src="My logo here" alt="logo"></a>
    	</div>
    <?php
    }
    ?>
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mobile menu customization’ is closed to new replies.