• Hi there,

    I’m creating a plugin for my website and for some reason i cannot find any reference on how i would go about adding a link to the main menu to access the plugin from the front end? all i have been able to find is admin menu links.

    any help would be greatly appreciated ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The answer is really theme dependent. Most themes use wp_nav_menu() to display front end menus. If your theme does as well, you could use the “wp_mav_menu” filter to insert HTML that links to your plugin’s content. Add this filter hook to your plugin code. The wp_nav_menu() function also has a number of hooks that might be more suitable than “wp_nav_menu”. Look through the source code to see what’s available.

    If your theme uses a custom function, try looking at its source code. Often such custom functions are essentially wrappers for wp_nav_menu() and the “wp_nav_menu” filter will still work. Theme functions might also have their own hooks or be “pluggable” such that you can redefine the same function after the theme is loaded.

    Thread Starter dxlwebs

    (@dxlwebs)

    Well that sucks, I thought there must have been a way to make a spot in the menu options to add the link but I will look into the theme I’m using thnx for the help

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Linking my plugin to the main menu?’ is closed to new replies.