Solved

Wordpress, how to add link to sites menu

Posted on 2014-09-03
3
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

756 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