Correct menu structure with clickable top menu for Sparkling theme

Hi Movin

I tried installing all the various plugins in order to have the parent menu clickable, but I keep on getting an error message, that says:

Unpacking the package…

The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

the website is http://staging.hinceonwine.com.au/ and I’m trying to get “Grapevine” clickable.

Thanks
Bing

Hi Bing,

The shared plugin attached to the following reply is working fine for me without any issue as shown in the attached screenshot.

https://colorlibsupport.com/t/correct-menu-structure/page/2/#post-28178

If you are facing the issue installing this plugin then just create a file colorlib-plugin.php in your following WordPress directory

/wp-content/plugins/

And then in that file add the following code.


<?php 
/*
Plugin Name: Colorlib Plugin
Description: Quick Custom Solution Plugin for Implementing Custom Solution.
Version: 1.0.0
Author: Movin
Author URI: http://freewptp.com/
License: GNU General Public License (Version 2 - GPLv2)
*/

function  custom_nav_menu_link_attributes( $atts, $item, $args ){
  if ( !wp_is_mobile() && $args->has_children  ) {
            $atts['href'] = ! empty( $item->url ) ? $item->url : '';
    }
  return $atts;
}
add_filter( 'nav_menu_link_attributes', 'custom_nav_menu_link_attributes', 99, 3 );

function func_make_menu_clickable(){
if ( !wp_is_mobile() ) { ?>
  <script type="text/javascript">
    jQuery(document).ready(function($){      
      if($(window).width() >= 767){
        $('li.menu-item a').click(function(){
          window.location = $(this).attr('href');
        });
      }
    });
  </script>
  <style type="text/css">
  @media all and (min-width: 767px) {
  .menu-item-has-children:hover > ul {
  display: block;
}
}
  </style>
<?php }
}
add_action('wp_footer', 'func_make_menu_clickable', 1);

Best Regards,
Movin

Hello Movin,

First of all, I’d like to say thank you for such a great theme in Sparkling. I love it!

I installed this plugin (14) and my top menu items won’t turn into links. I see it’s pointing to the correct page, but when I click the link, nothing happens. My site is hosted here for now: http://mosaictest.atwebpages.com/

Hopefully this is an easy fix!

Thanks,
Dan

I seem to be having a similar problem on client website at http://www.carolinaoffshorefishing.com/

Any “Parent” page having “Child” pages seems to have the link Let's Go Fishing! - Pelagic Hunter Sportfishing

Please advise how to correct this issue for: 1) desktops/laptops 2) tablets, and 3) smartphones {if there are different fixes for each}.

Thanks for a great looking theme otherwise!

I’m have the EXACT SAME issues with a client’s site at Catch Photo Gallery - Pelagic Hunter Sportfishing (mobile menu not working correctly).

Please advise.

Hi There,

To help keep support thread separates could you please create your own thread for your question here https://colorlibsupport.com/c/sparkling/ instead of replying on others thread as it makes the thread messy and hard to read.

If you want to you can also add reference of this thread in your newly created thread.

We would be more than happy to help you on your new thread.

Cheers,
Movin