Solved

Wordpress, how to add link to sites menu

Posted on 2014-09-03
3
145 Views
Last Modified: 2014-10-15
Hi,

I'm creating my first wordpress plugin. I've created the admin side of things without any problem. However now I need to make the plugin accessible on the frontend of the website.

I've tried searching Google but I'm not really getting an concrete answers on where I start.

I need to create a menu item in the sites main menu which links to the plugin so I can display various information on that page. The only information I can find so far would insinuate that I need to create a shortcode, create a page and add the shortcode into the page. Is this really the correct way to do this?

I have a wordpress book on my desk, it's been a great help when doing the backend of the plugin, but doesn't give me any information at all about integrating with the frontend of the website.

For reference, if it helps, the plugin creates a few custom database tables which will hold the rates of different members of staff. The backend allows an administrator to filter and edit the rates for different job roles, while also providing a CSV import to be able to populate the database. What I need to do now is display this information on it's own page of the website.
0
Comment
Question by:SheppardDigital
  • 2
3 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40301225
Is this really the correct way to do this?

Correct is a strong word, but yes.  This is a very common way of returning content because it gives the end user control over where the content appears and you can place other content above and below the shortcode.

What other technique would you prefer?
0
 

Accepted Solution

by:
SheppardDigital earned 0 total points
ID: 40301259
I found another way to do it.

Create a page on activation of the plugin. Store the page id and name using the add_option() method, and then parse each post on the frontend of the site, if the page name or id is matched, then set the page content to whatever I needed.

I did initially create a page and add a shortcode to the content of the page using the plugins activate method, but I wasn't keen as the user could remove the shortcode and it would no longer work.

As I've never worked with wordpress, I wasn't sure if either of these ways was 'best practice'.
0
 

Author Closing Comment

by:SheppardDigital
ID: 40381696
Found a way to do this.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are looking for plug-ins to add functions to your WordPress small business web site, take some time to read though this comprehensive list.  These are all the plugins I use for my customers WordPress web sites, as well as my own.  Be sure to …
WordPress can be pretty daunting, especially for a beginner, so I thought it might be a good idea to write an article to show how easy it is to get started in WordPress and to design a custom theme.  The first step is to check with your hosting comp…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question