Bilal Ahmad
Bilal Ahmad

Reputation: 301

Front End of Wordpress Plugin

This is my first plugin that i am developing. I have only one file in my plugin folder which has all the code that is handling my admin part. I have my own custom tables. I'm not using any wordpress table for it.

Structure:

plugin/amt

Now I have got amt.php file working for my admin part. It is retrieving and saving data into the database. Till here its all fine.

Now, I want to add some functionality in the plugin which will be shown on frontend of the website. Please guide me, how can this be done? I could think of following options:

  1. Add front end code in amt.php as well and use some kind of short code to display on front end of website under 'Sample Page'.
  2. Need to create a new folder/file for front end?

I'll be thankful if some one can guide me please.

Upvotes: 0

Views: 509

Answers (1)

Bilal Ahmad
Bilal Ahmad

Reputation: 301

I have got it working with the help of short code. Here is what i did. added this code in my main plugin file i.e: amt.php

add_shortcode( 'clan', 'clan_fn' ); 
function clan_fn() { } 

Create a new page from word press admin and simply call the short code as below and it will display what ever functionality you add in clan_fn.

[clan]

Upvotes: 1

Related Questions