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
}
?>