- This topic has 10 replies, 3 voices, and was last updated 6 years, 1 month ago by
Tom.
-
AuthorPosts
-
October 10, 2017 at 12:40 pm #400860
Joseph
So I added this to my functions php file
add_action( 'generate_inside_mobile_header','tu_mobile_header_html' ); function tu_mobile_header_html() { ?> <div class="mobile-header-content"> <i class="fa fa-phone"></i> 858-999-2870 </div> <?php }
I want it to appear next to the menu burger on mobile. But nothing is showing up.
October 10, 2017 at 11:11 pm #401069Leo
StaffCustomer SupportHi there,
Looks like your mobile header is disabled:
https://docs.generatepress.com/article/mobile-header/Also just want to make sure you are adding it to the child theme’s functions.php and not the core file as it will be erased through update.
Let me know if this helps.
October 11, 2017 at 7:17 am #401290Joseph
Oh, there is no way to have it appear right next to the burger? I don’t want it to be a mobile header, but was hoping it would sit next to the mobile burger menu.
October 11, 2017 at 9:25 am #401403Leo
StaffCustomer SupportTry this hook instead: https://docs.generatepress.com/article/generate_inside_mobile_menu/
October 12, 2017 at 2:34 am #401771Joseph
I tried to add this code:
add_action( 'generate_inside_mobile_menu','jd_insert_into_mob_menu' ); function jd_insert_into_mob_menu() { ?> <i class="fa fa-phone"></i> <?php }
In both a child theme, which I then deleted and in Code Snippets. Nothing. I also tried it with
generate_inside_mobile_menu_bar
No phone icon anywhere in the menu, on the menu bar (when the burger is showing) etc.
EDIT: Got it to appear in the ‘generate_inside_mobile_header_menu’ but it just appears next to the burger, and it becomes part of the burger (meaning when I click the number/phone icon, it just opens up the menu, and doesn’t click to call)
October 12, 2017 at 2:52 am #401776Joseph
I’m guessing it’s just not going to be able to appear in that bar next to the burger? I’ve put it in the mobile header for now but I’m hoping it can appear in the mobile menu bar next to the burger so it’ll be streamlined.
October 12, 2017 at 8:59 am #402032Tom
Lead DeveloperLead DeveloperMaybe try something like this:
@media (max-width: 768px) { .main-navigation .menu-toggle, .mobile-header-content { display: inline-block; width: auto; } }
October 12, 2017 at 9:11 am #402047Joseph
That worked!! Awesome.
One last question, and this is okay if it’s not possible, what’s the css to do the spacing across the bar between menu items? Either way, I’m stoked it works.
Would just like to put some space between the click to call button and menu burger.
For now, I did this:
.mobile-header-content a { color: white; padding-top: 10px; padding-right: 75px; }
Which looks fine, just wondering if there is something more elegant.
October 12, 2017 at 9:14 am #402051Tom
Lead DeveloperLead DeveloperYou could do this instead:
@media (max-width: 768px) { .main-navigation .menu-toggle { float: left; width: auto; } .mobile-header-content { float: right; line-height: 50px } }
October 12, 2017 at 10:33 am #402106Joseph
Thank you!
October 12, 2017 at 10:07 pm #402356Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.