LJ Custom Menu Links

LJ Custom Menu Links is a plugin that allows you to put extra links in the menus of most WordPress Themes. It is unique in the way that it doesn’t require any code changes to your theme as the extra links are added within WordPress core functionality. This plugin requires no technical knowledge to administer, it is all contained within the WordPress admin pages with a consistent look and feel for ease of use.

Functions:

  • Add Extra Menu links to your theme
  • Use pages as placeholders for menu links (This allows you full customization as to the location of your links)
  • Control if menus items are shown based on if a user is logged in
  • Shows a logout link if a user is logged in
  • Provides the ability to provide a link back to your admin pages only if a user is logged in
  • Full menu sorting available

To add flexible location links (Dynamic Links) you need to create a new page as a placeholder for that link, under the edit page menu is a box to control what link to show. Please see the screenshots on the next page for a description. Links created in this way dont have the ability to choose the target window (you may still control the visibility of the link via the private or public based on the page settings, and also the ordering based on page settings).

The admin page now also contains a list of Dynamic Links, which can be deleted or edited from within the LJCustomMenuLinks admin section.

To add LJCustomMenuLinks please use the LJCustomMenuLinks item in the Admin section, these links are added to the end of the standard wordpress menu system but have full customization ability.

The plugin has also had an attribution function added. If you would like to provide attribution for the plugin then add the following code into your wordpress theme. The footer is a good place for it.

  if (function_exists('LJCustomMenuLinksAttribution')) {
    LJCustomMenuLinksAttribution();
  }

LJ Custom Menu Links at WordPress Extend

42 Responses to LJ Custom Menu Links

  1. kel says:

    Works as advertised! Thanks. Any way to make it add the menu item “mixed” within other WP generated menu items (ie Page 1 | LJ Custom Link | Page 2) instead of appending all menu links after the pages?

  2. Jon Smith says:

    @kel
    Short answer is not easily. The main reason I developed this plugin was to show some links only when I was logged in, so the end was the perfect position for them. There may be some way of adding these links in the middle of the pages but not with the current form of this plugin. This maybe something I investigate further if enough people are interested. Thanks for checking out my plugin.

  3. Henrik says:

    Very nice! Works exactly as I wanted. Searched for something like this for days…! Good job!

  4. kel says:

    @Jon Smith Thanks for the reply. As I suspected… I wish the next version of WP gets more flexible navigation/menu options. I do like what your plugin does and yes, it’s a pretty cool trick to quickly get the “Logged in” menu items. Thanks again!

  5. Pingback: Top 10 Wordpress Plugins – July 2009 | Enterprise Mastermind

  6. Annonces says:

    Very good plugin ! I found a new solution for my website with this. Thanks a lot.

  7. Pingback: Top 10 Wordpress Plugins – August 2009 | Enterprise Mastermind

  8. This plug-in is perfect for what I wanted to do. Thanks so much for the hard work you put into this and making it available.

    I do have one suggestion that I hope you’ll consider. When I have multiple child pages below a parent link, the size of the box that the link is contained in varies. If these could all match the longest child page link, like WordPress does your plug-in menu items would blend in totally with the WordPress ones.

    You can see what I mean with the menu on my blog. WordPress pages are linked below “Testimonials” and your plug-in links are below “Gallery”.

    If you can make time, it would be great if you could look at this.

    Thanks again for a great plug-in!

  9. Jon Smith says:

    @Martin Bailey
    Hey Martin, Thanks for your input. This works for my theme so I haven’t yet encountered this problem. I am currently downloading the theme that your site is based on for my test environment and will let you know shortly.

  10. Jon Smith says:

    @Martin Bailey
    Martin,

    It appears this problem is related to your theme. I have emailed you with further details to the address used to register your comment.

    Cheers,

    Jon

  11. @Jon Smith
    Thanks Jon! The private you sent me to try works like a dream, and so fast too!

    I really appreciate it. Thanks again for your help, and for creating and making this great plug-in available.

    Martin.

  12. Craig says:

    Hi,

    Is it posible to disply only the child links of a parent.

    cheers
    Craig

  13. Jon Smith says:

    @Craig
    Craig, I am not quite sure what you mean. The child links will need a parent to be attached to.

    If you dont want the parent to link to anything, create a dummy page and then activate Dynamic Links on the page with a URL of #.

    Hope that helps.

    Jon

  14. Craig says:

    Thank for the quick reply Jon,

    what i ment was if i create a custom menu like this

    parent
    >> child 1
    >> >> grandchild 1a
    >> >> grandchild 1b
    >> >> grandchild 1c
    >> child 2
    >> >> grandchild 2a
    >> >> grandchild 2b

    is it posible for me to display the grandchild links on the child page with a simpe tag. So on the page “child 1” i can list the grandchild links

    grandchild 1a
    grandchild 1b
    grandchild 1c

    cheers
    Craig

  15. Jon Smith says:

    @Craig
    I think i know what you mean.

    For example this page is listed under “Software -> WordPress Plugins -> LJ Custom Menu Links”

    Just a third layer of menus? Or do you want to display them somewhere else like your sidebar?

    Sorry if I am not understanding you correctly but if I have then it is a theme/css dependant issue.

    Cheers,

    Jon

  16. Craig says:

    Hi,

    Basicly im looking for somthing like this code, that will work for the custom menu

    $my_page_id = get_the_ID();
    wp_list_pages(‘child_of=’.$my_page_id);

    in wordpress this will list the child pages of the current page.

    What im look to to is list the child (Custom menu links) on the parent page.

    I know i could do it manually like this

    wp_list_pages(‘include=5,6,20,30,35,40’);

    but i would have to update the code every time.

    cheers
    Craig

    I have just tested the wp_list_pages include/exclude commands and it adds all the “Custom menu links” regardless ?

  17. Jon Smith says:

    @Craig
    Ok,

    Now I know what you mean.

    Maybe you need to use the Dynamic Link side of Custom Menu Links. This works by having a Page as a place holder, you then assign a link to that page (via the page edit screen) and it should do what you are looking for.

    >> I have just tested the wp_list_pages include/exclude commands and it adds all the “Custom menu links” regardless ?

    This is in part caused by the way Custom Menu Links works, I need to add something to the code that will stop it from outputting unless you are calling wp_list_pages to list everything.

    LJ Custom Menu links aren’t part of the page listing, they are added to it after wp_list_pages finishes processing. That is why exclude and include wont work for them. But the Dynamic Links are pages themselves so they behave in the same way with regards to including/excluding, private/published settings.

    Hope that helps.

    Cheers,

    Jon

  18. Pingback: Wordpress Plugins:Dynamic Content Gallery,The Excerpt Reloaded,WP-SpamFree Anti-Spam,Ad-Minister,Plugin Manager,LJ Custom Menu Links,Easy Adsenser,Post Google Map,Random Pages Widget,Vipers Video Quicktags | Cosmos Blog -- Internet News,Life,Culture,Polic

  19. Ivan says:

    Great idea!
    But… is it possible to add the class “current_page_item” to a real current page? Currently the class “current_page_item” is assigned to “home” item…

  20. Jon Smith says:

    @Ivan
    Can you please provide more details. What are you viewing when current_page_item is assigned to home (All this is still handled by WordPress, my plugin doesn’t change this).

    If you can provide more details I may be able to help.

    Cheers,

    Jon

  21. Ivan says:

    Jon,
    Let’s suppose we have following (standard) pages:
    1. About (alias “about”)
    2. Contacts (alias “contacts”)
    Standard wordpress function wp_list_pages() will generate something like this:

    <li class="page_item page-item-1"><a href="http://site.com/about" title="About">About</a></li>
    <li class="page_item page-item-2"><a href="http://site.com/contacts" title="Contacts">Contacts</a></li>

    If we are on page “About”, wordpress will add current_page_item to the class of the item:
    <li class=”page_item page-item-1 current_page_item“><a href=”http://site.com/about” title=”About”>About</a></li>
    Next I turn on your plugin and add new page “Portfolio”. For the page I set LJ Custom Menu Links URL = http://site.com/portfolio. Let’s say the URL is the permalink of a category. Now go to the URL.
    Your plugin will generate:

    <li class="page_item page-item-1"><a href="http://site.com/about" title="About">About</a></li>
    <li class="page_item page-item-2"><a href="http://site.com/contacts" title="Contacts">Contacts</a></li>
    <li class="page_item page-item-2"><a href="http://site.com/portfolio" title="Portfolio">Portfolio</a></li>

    So the current page is “http://site.com/portfolio”, but the menu item has no class “current_page_item”.

    Is it possible generate such item?
    <li class=”page_item page-item-2 current_page_item“><a href=”http://site.com/portfolio” title=”Portfolio”>Portfolio</a></li>

  22. Jon Smith says:

    @Ivan
    Ahh, Sorry now I get what you mean.

    The answer is no. The idea behind the plugin is to provide outbound links to other sites/whatever you want. The plugin is not aware (or able to be aware, for dynamic links) what page/category/tag is currently being viewed.

    Cheers,

    Jon

  23. Jason Hobbs says:

    Love the plugin! I am having a slight problem, more of a little bug actually. I am using iBlogPro 3 theme (the people that created that theme are how I heard about your plugin) and when I add your plugin, it adds it to the menubar but it repeats it below my actual menu bar. Is there a way to correct this so it only shows in the menubar at the top?
    http://www.nlsff.com

    The link in question is NLS Help Forums

    Thanks, small donation made 🙂

  24. Jon Smith says:

    @Jason Hobbs
    Are you using a Subpage plugin? Or does your theme do this for you?

    The problem you are having is an incompatibility with the theme or a plugin. The way my plugin works is by grabbing the output of a certain WP function and then appending to it, that is how I can do what I have done without needing theme modification. I have been recently working on this problem and have a few solutions for you.

    The next release of LJ Custom Menu Links, due in a couple of days has the ability to stop overriding the wordpress filter action. The only downside to this is you will need to make a minor modification to your theme to display the menus. This is a trade-off between using core WordPress functionality and the ability to have compatibility with other plugins that use the same method.

    The second option, and maybe the best option for you in this case would be to use an LJ Dynamic Link. To do this, create a new page called “NLS Help Forums” then use the LJCustomMenuLinks – Dynamic Links box to fill in the link information. Once you have done this delete the NLS Help Forums link from within the LJ Custom Menu Links – Custom Links section.

    Let me know how you go and we can see if there is anything else I can do for you.

    Cheers,

    Jon

  25. Jason Hobbs says:

    Thanks Jon, I went with the second option and it worked like a charm! 🙂

  26. Jon Smith says:

    @Jason Hobbs
    Glad it went well. Thanks for the donation. If you have any further requests or queries, dont hasitate to ask.

    Cheers,

    Jon

  27. Guillaume says:

    Help !
    I was using the LJ Menu plugins since a couple days . And , 30 minutes ago, the menu just disappear. … I did not touch anything !!!
    What can I do ?

    Please help me !
    The site is avocatcriminel.ca/blogue Thanks !

  28. Jon Smith says:

    @Guillaume
    I notice that you have the problem fixed now. Was the option to “Use wp_list_pages Filter” turned off by any chance?

    Cheers,

    Jon

  29. Guillaume says:

    Yes , I fixed it with wp_list_pages Filter

    Thanks !!

  30. Pingback: Top 1000 WordPress Plugin Authors « Metode de promovare

  31. I just tried to install your plug-in and received this error message:

    Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /home/content/d/a/w/dawdesigns/html/wordpress/wp-content/plugins/lj-custom-menu-links/lj-custom-menu-links.php on line 13

    I am running the latest version of WordPress, hosted on Go-Daddy.

    Any help appreciated.

  32. Jon Smith says:

    @Debbie Williams
    This problem seems to be caused by PHP4. Currently the plugin is only PHP5 compatible.

    Cheers.

  33. John says:

    Using your plugin, is it possible to add icons (in lieu of text) that link to external sites? I *think* so, but not sure how to go about doing it…and this plugin looks like it would solve my challenge.

    Thanks,
    John

  34. Jon Smith says:

    @John
    I dont beleive this is possible. At least not directly through WordPress (unless your theme does this), or through my plugin.

    Cheers,

    Jon

  35. Joshua says:

    I am having trouble activating this plugin. This is what it says:

    Plugin could not be activated because it triggered a fatal error.

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in E:inetpubvhostschadashchay.comhttpdocswp-contentpluginslj-custom-menu-linkslj-custom-menu-links.php on line 13

    So… what do I do?

    -Joshua

  36. Daisy Peel says:

    I’m working on a WordPress site where I’m embedding an SMF forum in the WordPress site. I’ve got the SMF Forum embedded and am trying to use your plugin to put a navlink and submenu items at the top of the wordpress page. I’d like to be able to add the option to target the iframe, in addition to _self and _blank. So, in your .php file I added the following code:

    <option class="level-1" value="myframe" >Target Iframe named myframe

    However, when I go to the actual page, the link opens in the same window but NOT in the iframe, and when I look at the source code, it says:

    So the word myframe is not being written to the page.

    Any suggestions?

    Thanks!

  37. Jon Smith says:

    @Daisy Peel
    What type of links are you using, one setup via a page or one setup via the Admin Console?.

    Cheers.

  38. Jon Smith says:

    @Joshua
    You require PHP5 for this plugin.

  39. Mark says:

    Installed, worked great, then all of the sudden i got the Parse Error out of nowhere. Turned out I was running PHP4 all along and updated to PHP5 and all was good.

  40. tony fraser says:

    AWESOME! I was trying to make placeholder top nav (like people -> tony, carol, lyndon) while people was not clickable. This worked perfectly.

    I tried to do something similar with a different plugin but it just didn’t work right.!

  41. rayray says:

    Hello, is there a way to choose existing pages as parent. It seems that the plugin only allow me choose links that I created through the plugin as parent.

  42. Mark Berry says:

    Awesome! This will allow integrating a couple of blogs into one site and/or into a Joomla site. Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *