Site logo

[Support request] Extra links added to Off-Canvas Menu

Home Forums Support [Support request] Extra links added to Off-Canvas Menu

Home Forums Support Extra links added to Off-Canvas Menu

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1572184
    Cayden

    Hi There,

    I’m struggling with an odd issue at the moment. For some reason, there are some extra links being added to the Off-Canvas menu. I created a new menu titled Mobile Menu that is set to the Off-Canvas panel – https://i.imgur.com/M5AfXLZ.png. I’m then attempting to add a hook that adds a search bar to the off-canvas panel, but it’s being wrapped by those mysterious link tags – https://i.imgur.com/aYHfkV6.png. You can see from that screenshot that it’s also wrapping the close button. I’ve looked through all my functions and hooks and nothing is set to wrap those with a tags.

    Code to add the mobile search bar is as follows:

    add_action( 'generate_inside_slideout_navigation', 'get_mobile_search' );
    function get_mobile_search() {?>
    	<div class="mobile-search-container">
    		<form id="mobile-search" action="/" method="get">
    			<input class="mobile-search-input" id="mobile-search-input" name="s" type="search" placeholder="Search..." aria-label="Search">
    			<input class="mobile-search-submit" id="mobile-search-submit" type="submit" value="" aria-label="Submit">
    		</form>
    	</div>
    <?php }

    On top of that, there are also other empty links being added throughout the Off-Canvas menu – https://i.imgur.com/JqSJWBt.png. Again, I’ve looked through my child theme and even disabled it in favor of the main GP theme to see if there was a conflict there but there isn’t. I’ve also uninstalled and re-installed the main GP theme, and the plugin. Deactivated every plugin and still seems to be an issue. Any help would be greatly appreciate.

    Best,
    Cayden

    #1572213
    Elvin
    Staff
    Customer Support

    Hi,

    To move the search bar to the Off-canvas menu (mobile menu you’re using), consider trying David’s reply here:
    https://generatepress.com/forums/topic/mobile-search-box-inside-the-navigation-menu/#post-1556266

    As for the link, that particular anchor is the trigger anchor for the close toggle of the off canvas. It doesn’t wrap around the menu items within the Off-canvas.

    If you check closely, it only wraps the close icon and the mobile search you’ve hooked into the generate_inside_slideout_navigation.

    #1572258
    Cayden

    Hi Elvin,

    Thanks for your response. Is the addition of the anchor wrapping around the close toggle a new addition to GeneratePress? I have a site running the same theme/child-theme setup and it doesn’t have that and I was able to successfully use the generate_inside_slideout_navigation to add a mobile menu to the top of the Off-Canvas panel. https://i.imgur.com/rnIDZik.png

    Also, your answer doesn’t explain all the extra anchor tags being added to the menu https://i.imgur.com/ilBOX5B.png.

    #1572296
    Elvin
    Staff
    Customer Support

    Is the addition of the anchor wrapping around the close toggle a new addition to GeneratePress?

    No, this is not something GeneratePress or GP premium add by default. It must be from a code snippet or a plugin.

    Also, your answer doesn’t explain all the extra anchor tags being added to the menu https://i.imgur.com/ilBOX5B.png.

    Ah that’s right my bad.

    To determine which is the cause of this, we can do the following.

    Disable all plugins except GP Premium and check if it still occurs.

    If it doesn’t occur, we can say that some plugin is adding the extra anchor tag to the off-canvas contents.

    That said, we can activate the plugins one by one to check which one is causing it.

    Another way of determining this is to check your snippets (JS or PHP) for anything that adds in this anchor tag on the off-canvas content. Try removing them one by one to see which one is causing the issue.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.