Solved

Wordpress, how to add link to sites menu

Posted on 2014-09-03
3
154 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

How to install BuddyPress on your self-hosted WordPress site It’s been called everything from “social networking in a box” to “Facebook without the terms of service,” but until Feb. 16, BuddyPress was a relatively unknown outside the WordPress MU…
Do you think that WordPress is just for blogs?  Think again!  WordPress is really a fantastic all around platform that you can use to develop websites on.  Integrated into its basic functionality is the ability to create pages using your choice of a…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
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…

705 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