You’re getting a syntax error because you forgot to close off your first if. Also, you need to close off the first php block.
<div class="mobile-nav">
<?php if ( ! is_front_page() && ! is_home() ) { ?>
<div class="menu-btn" id="menu-btn">
<div></div>
<span></span>
<span></span>
<span></span>
</div>
<?php } // <-- You forgot to put this in ?>
<div class="responsive-menu">
<?php
if ( ! is_front_page() && ! is_home() ) {
wp_nav_menu();
}
?>
</div>
</div>
Related Posts:
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Logout and redirect using the WP Menu
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- Add login hyperlink to secondary navigation menu
- Menu Custom Data Attributes
- How to modify mobile nav menu text in theme
- Nav-Menu not showing up
- how to changes mobile menu toggle breakpoint in WordPress
- Custom Navigation Bar JSON Syntax Error in JSON at Position 0
- Adding first / last CSS classes to menus
- start_lvl Ignored in Custom walker_nav_menu
- Hide main div if wp_nav_menu is empty
- Check if a menu is empty?
- How to remove a metabox from menu editor page?
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- How to add active class to custom menu using while loop and wp_list_pages
- WordPress menu deletes when trying to add a hook
- Using PHP to toggle stylesheet and header image, set in cookie
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- items_wrap not working
- Style wp_page_menu() items
- wp nav menu: add attributes to menu items [duplicate]
- Have CSS Class Added with `is_page()` WP function
- Shortcode content output but not in correct place
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Run a filter when a walker runs
- Change Navigation Bar based on logged in or not
- Multiple WordPress Menus that will only display all pages
- How to style options page in dashboard?
- Menu Limitations
- Automatically adding new post categories to menu
- Add data attribute to each li in menu
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- Unique icons next to each WordPress menu item
- Child page menu in sidebar
- Title Case WordPress Menu Items
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- How to change menu order item
- responsive.css in the WordPress should be prioritized
- Redirect to another page using contact form 7? [closed]
- height should be set to auto to avoid pixelation in the post thumbnail function
- Register a menu – Error Header
- How to style one item from main navigation?
- How to make container class in PHP
- Creating a mobile site by adding a new class to the body tag from functions.php
- Add value to new attribute inside WordPress menu items
- CSS change in woo commerce Place Order Text [closed]
- Get the name of menu item with wp_nav_menu
- Default Nav Highlight
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- How to add aria role and schema markup to custom walker container
- Extend Menu Walker Output
- Why can’t I add a custom image in my navigation?
- Remove submenu item from list
- conditional: if is page, and all subpages
- wp nav menu: show submenu below li item
- Remove the Tag from wp_nav_menu
- Menu not styling. New menus functionality giving me a headache
- Styling an “active” link outside of WordPress default menu
- Adding a navigation page state to individual blog and portfolio pages
- How to display already created menus via php?
- Providin exception to WordPress wp_nav_menu Custom CSS Classes
- How to make only the valid active page of a multilevel menu active with – “.nav li.current-menu-item a”?
- PHP function for horizontal Woocommerce thumbnails and badges
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- I want to show cart items number if any or nothing, simple CART text
- How to put 2 php codes in functions.php without site crashing
- Menu not updating for logged in users after redirect
- I got big white screen when i attach main style sheet of Html in functions.php
- How to let mobile navigation menu close when link is clicked?
- Redirect User when they click Menu Option
- Add element after navigation element title don’t works like I expect
- Site title not showing. Please help me
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Add parent menu item in sub-menu in custom nav_walker
- Add class for the_post_thumbnail_caption()
- How to create a sub-page of sub-page?
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Displaying POST content with HTML tags and all
- How limit the width of a fixed menu-bar on scroll?
- Pulling a variable into the wp_nav_menu function
- How I can add div to menu?
- Styling admin page rows in order of importance (checkboxes)
- How to have Function of a plugin using global vars into a shortcode?
- Add the “.current-menu-item” class to tag?
- WP_Nav Highlight Parent Issue
- WordPress adding in site URL to header links
- Cant get theme to change footer color through theme customizer
- How to change the menu color
- Nav Menu Display
- How to add margin underneath woocommerce total price amount -> productpages
- How do I get Roboto Google Font to display normal font-style? [closed]
- Load slideshow.css file only if Slideshow is checked / on
- Open WordPress Page from selected option dropdown
- Sorting Problem
- How to add different menu items on different menus?
- Nav menù doesn’t display selected pages