wordpress plugin

Hi, I am learning wordpress plugin. So far it does not look too hard. I was able to add a menu item in the WP admin area and that I pretty much understand. I was able to perform a jquery file upload to a php file. So far I don't see any problems.

However, for the life of me I want to add a link to the top menu when you visit the public site and when you click on that link it loads a function in my plugin. How do I make the connection? I've been all over google and youtube. Everything I read points me back to add_menu_page but that only adds to the admin area.
Robert SaylorSenior DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David H.H.LeeCommented:
Hi Robert Saylor,
You may refer this tutorial link how to create the menu item in wordpress. https://codex.wordpress.org/WordPress_Menu_User_Guide

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robert SaylorSenior DeveloperAuthor Commented:
Thanks David,

I am looking for the 1 line of code that allows the plugin to append to the menu. I am writting my plugin as open source to learn and don't want the user who installs the plugin to have to go into modify the menu's.
David H.H.LeeCommented:
Noted. You can refer further on this article how to define your own custom menu with your plugin
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

Robert SaylorSenior DeveloperAuthor Commented:
Thanks but that is for the admin dashboard. I am using those with no issues just the frontend I am trying to append to the existing menu (nav bar I think is what they call it)
Jason C. LevineDon't talk to me.Commented:

What if the site has no menus, or multiple?
Robert SaylorSenior DeveloperAuthor Commented:
ok, maybe I need to ask this a different way.

How do I make a link that is public? Then that link would call a function in my plugin. I think that might be the better way.
Jason C. LevineDon't talk to me.Commented:
Unless the link calls a specific PHP file, there isn't really a good way to do that outside of creating a whole new taxonomy and then hijacking it to call the function (massive overkill and difficult to boot).

Instead, add a query string and test for it in your function calls.  If the string exists, call the function completely, else quit.
tomas pattersonCommented:
Hi Robert,
Glad to know that you are learning WordPress plugins and getting it easily. No doubt, that WordPress is an unbeatable CMS that is preferred by ample of webmasters. As you have asked about addition a link for your plugins hence you may take a look at this thread https://wordpress.org/support/topic/adding-a-admin-menu-item-that-links-to-a-url. There are multiple ways to do this task, advised by professionals. I hope it will be helpful.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.