love using the new wordpress menu builder. it’s perfect for linking to everything, but… is it possible to create a jquery link? in other words, having one of my menu links toggle a div i’ve already built in? or do i have to ditch the WP menu alltogether?
i’ve tried using the XFN “rel” area, but it cuts out my brackets. ideally, i need it to look like:
and WP auto-corrects it to
I would try using a jquery class selector for that link.
In the WordPress menu builder if you don’t see the option to add a custom class to a menu item you can turn it on under screen options in the menu admin area. Once you add a class you should be able to use jquery to select only that menu item.
Hopefully that’s helpful. Let me know if you have any trouble adding the extra css class.
hi jonathan, thanks for the response! i see where the css class area is on the menu, just not entirely sure how to use the menu option’s css to call the div. can you give me an example of what you mean…?
@drkknght, maybe something like this:
Let me know if that doesn’t make sense.
hi jonathan – thanks again for following up
OK, i tried what you recommended, using the appropriate div tags and code – which, for the record, ends up looking like this:
however, that resulted in the following:
Parse error: syntax error, unexpected ‘(‘, expecting T_VARIABLE or ‘$’ in /nfs/c03/h06/mnt/55017/domains/toonbarn.com/html/wordpress/wp-content/themes/arras/header.php on line 22
was i correct in placing this in the header file, between the actual head tags? and should i have wrapped the code in <?php and ?> or did i format that incorrectly
It might be good for you to read a little about basic jQuery at http://docs.jquery.com/Main_Page. That will give you the basics on how to include jQuery on your pages.
Also, the div you have with the ID of #toons-list, do you have that hidden right now? If so, how did you go about that?
If you used CSS and display: none you don’t have to use show(). You can use choose between a bunch of jQuery effects at http://api.jquery.com/category/effects/.
Let me know how it goes.
- The topic ‘add a complex, jquery link in the WP default menu builder’ is closed to new replies.