Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

script integration into wordpress WordPress

  • REFUNDED

I have purchased the advanced-menu-manager-system for codecanyon because of a limitation with wordpress menus, that by default will not post more than 49 ish pages into a wordpress menu. It is a known issue but no fix date has been advised so it could go on for years.
Where is a potential solution about changing the php.ini but in this case it is not an option and therefore a work around must be found.

The advanced-menu-manager-system work perfectly in this case.
And it is a manageable solution for the client.



http://aerobicexerciseandfitness.com/birdsville/

There is the top test menu and directly underneath is the colored ubermenu/plugin menu which will be disabled.

the top menu while working, does not have any style and I am not sure the js is loading either.
I have messed with paths, placed the scripts in the header and the footer and index, also in the theme folder etc.
I have placed the main files/folders in various places and tried adjusting the paths also but I do not seem to get it right.

The install manual...what there is of it is here:
http://aerobicexerciseandfitness.com/birdsville/html_manual/

this is a direct link to the menu call and demo:
http://codecanyon.net/item/advanced-menu-manager-system/full_screen_preview/637633

this is the menu call in the sidebar:
<?php include ("include/amms.class.php"); $amms = new amms; echo $amms->render_menu("main_menu", "menu1", "horizontal"); ?>

but I have tried others and get the same result the menus work but here is no styling or default styling is being applied.

Eventually the menus need to be colored like the faulty menu below.
I could hand code but again that is not an option as the client would never b able to manage/edit/alter the menus in any way.


This should not be difficult for someone who knows what they are doing, but I am not sure what I am doing wrong.

can anyone assist?

Answers (3)

2013-05-08

Daniel Yoen answers:

Hello,

first, copy all the files in /js folder to /theme-folder/js
then, copy all the files in /css folder to /theme-folder/css

then, put this line to functions.php
add_action('wp_enqueue_scripts', 'node_js_scripts', 5);
function node_js_scripts()
{
wp_register_script('jquery-ui-custom', get_template_directory_uri() . '/js/jquery-ui-1.8.16.custom.min.js');
wp_register_script('nested-sortable', get_template_directory_uri() . '/js/jquery-ui.nestedSortable.js');
wp_register_script('blockui', get_template_directory_uri() . '/js/jquery.blockUI.js');
wp_register_script('jquery-query', get_template_directory_uri() . '/js/jquery.query.js');
wp_register_script('amms-script', get_template_directory_uri() . '/js/amms.js');

wp_enqueue_script('jquery-ui-custom');
wp_enqueue_script('nested-sortable');
wp_enqueue_script('blockui');
wp_enqueue_script('jquery-query');
wp_enqueue_script('amms-script');
}
add_action('wp_enqueue_scripts', 'node_custom_styles');
function node_custom_styles()
{
wp_register_style('custom-style', get_template_directory_uri() . '/css/jquery-ui-1.8.16.custom.css', array(), '20130508', 'all');
wp_register_style('custom-amms', get_template_directory_uri() . '/css/amms.css', array(), '20130508', 'all');

wp_enqueue_style('custom-style');
wp_enqueue_style('custom-amms');
}


hope this help :-)


Graham Kite comments:

Thanks have tried that. does not work if I put the links in the header as well as that it applies style..looks like a reset to the page. takes out the background makes the theme narrower etc. So something is getting applied to the site but it does not impact the menus.

I'm guessing it does enqueue the script but something is still wrong.

the site currently has your add_action in the functions.php and the js and css in the correct folder in the theme directory.

I even dragged the include folder in there and (not that I was expecting it to) it still does not work.

This should be a really simple job. I just don't see what I am missing.


Daniel Yoen comments:

I see this error on console ;

Uncaught TypeError: Object [object Object] has no method 'simpleMenu'

from Documentation :

simple_menu.js (Simple JQuery menu, USED ONLY on preview, not on application)


Daniel Yoen comments:

I see this error on console ;

Uncaught TypeError: Object [object Object] has no method 'simpleMenu'

from Documentation :

simple_menu.js (Simple JQuery menu, USED ONLY on preview, not on application)


Graham Kite comments:

ok that i getting a bit out of my depth.
Don't really know javscript and jquery.

I don't see simple_menu in the js that is enqueued


Does that mean i need to enqueue simple_menu.js?
remove it from the directory?
fix some js?

I renamed it in the directory to deactivate it and that did not work. So should I enqueue it?
not really sure what to do here. or how to fix that.

2013-05-08

Abdelhadi Touil answers:

Hi.
This menu script needs a database to be installed, I think it's not a good solution to add such menu, maybe it'll slows your website.
Have you tried to fix the wordpress menu problem? As I see there are fixes, that's one for example:

[[LINK href="http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-custom-menu-items-limit-in-wordpress/"]]http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-custom-menu-items-limit-in-wordpress/[[/LINK]]

[[LINK href="http://presshive.com/tips/wordpress-custom-menu-limit-fix/"]]http://presshive.com/tips/wordpress-custom-menu-limit-fix/[[/LINK]]

If you want to use third party solution, I think it's better to look for something developed for WordPress.
I wanted just to give some help :)
Good luck!


Graham Kite comments:

gone through all of this before posting here. could not find a working fix. And not really possible to get to the hosting co and it will be moved as soon as it is working so that means it would go live and not work and then there would be delays etc.

I'm open to all options but this seems to be the simpler, cleaner and most effective method.

Thanks for you help.
There is a lot of issues with the wordpress menu error, there seem to be some people that say it works and others that don't and after all that it is dependent on the hosting company doing it. And it can have side effects of slowing the server if the site gets a lot of traffic, so I think this is the better solution at present.

There is no guarantee even if a host company changed the settings, that they would not change back in the future.

It seems hostgator was sold sometime back and a lot of people are reporting downtime and are unhappy with hostgator now. So regardless of whether it was sold or not, there are now a lot of issues and a lot of downtime being reported.

I would rather not be at the mercy of a hosting company and find out 12 months down the line that there is an issue and they will not fix it.


Graham Kite comments:

it is known to wordpress but as yet they have not decided to fix, and the wordpress menu system is very cumbersome when you have a lot of pages. it always puts the new block at the bottom and you have to drag it all the way to the top.

This system also puts each of the submenus in the section you want so it is far more efficient.


Abdelhadi Touil comments:

But I think with the script you want to use, you must add links manually right? Because it's not a WordPress solution. What do you think?


Graham Kite comments:

yes but it is easy to do and I can give them a step by step guide.

If I hand code the menu they would never be able to alter it and then I would be manually adding pages at their mercy.
Same for hosting, if there are hostng issues in 12 or 18 months it would fall on me to fix, and that could be very time consuming.

I would rather avoid that totally.

using a db should not really impact the site. The db would always stay clean and if using wordpress menus it would pretty much be a database table also. So it should not really impact on the site speed.

I had thought about trying to write a form, but I think that would be difficult to allow changes.

I also am going to look at the option of styling the links without the js, but the theme is ithemes builder and it had a loooot of inline styles and kind of bloated code, so it is damn difficult to figure out what to target in firebug.

But I will be looking at that tonight.


Graham Kite comments:

I have rewritten the enqueue for both css and also js and it is loading both fine but the menus are not displaying properly.
What other options are there, seems like the only thing left is to restyle the css?


Abdelhadi Touil comments:

As I see in your website the menu isn't as it should be; there is no fade effect like javascript is not working, also it could be better looking.
If you can send me the script so I can test it locally in my pc, and if I resolve the problem I'll tell you how to do it.
Good luck!


Graham Kite comments:

Have sent you a message.

2013-05-08

MDan answers:

Hello,

The jquery is loaded on the website.

The error shown in this case is:
TypeError: $(...).simpleMenu is not a function

I think the problem is with the way jquery is included.
<strong>Make sure you're including the jQuery libary before the menu script.</strong> Let me know if that worked for you.


Graham Kite comments:

I'm re-writing the enqueue scripts now
and I have have put the jquery enqueue at the top of the functions and will make sue the load near the bottom, which I believe is setting to true to load near the footer and false (default) to load near the top


Graham Kite comments:

I have re-written the enqueue functions to
1: make sure they are dependent on jquery
2: the enqueue sequence has jquery loading first and then the other scripts loading so that
the menu scripts are now all dependent on jquery so it must load before they load, but it still is not working.