I need to add an image below the menu items in mobile menu. For desktop I’m using a custom widget that I added to header, but for mobile I need to add it inside the opening mobile menu. Is it somehow possible to do achieve that?
Hey kunzi,
Could you post a link to the page in question so that we can take a closer look please?
Best regards,
Rikard
Sure
Hi,
Thank you for the update.
You can add the image directly in a menu item. To do that, add a new item in your menu and replace the default Navigation Label with an img tag. Example:
<img src="http://site.com/wp-content/uploads/2020/01/image.jpg" />
Enable the CSS classes in the Screen Options, add “only_mobile” in the CSS Classes field, then use the following code in the Quick CSS field.
@media only screen and (min-width: 768px) {
.only_mobile {
display: none;
}
}
This will hide the new menu item in desktop view.
Best regards,
Ismael
Hi,
Thanks for a solution. it’s ok, but it would be better if we could get the logo as a widget. We have this function in functions.php that changes the logo on certain pages. Do you think it’s possible to show certain widget (that has widget logic) in the mobile menu?
Hey,
Could you please try using a plugin such as this one – https://wordpress.org/plugins/shortcode-in-menus/?
Cheers!
Yigit