Solved

Wordpress, how to add link to sites menu

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
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…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now