Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8820001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:30:08+00:00 2026-06-14T05:30:08+00:00

hi I am very new to wordpress plugin development, I created a plugin that

  • 0

hi I am very new to wordpress plugin development, I created a plugin that is adding a Sidemenu to show jquery dialog,

Now I’m trying to show a form in a page to front-end users, but i’m very confused how to start,

I want to show a link in side menu for front-end user, when user click on it i want to open my custom page with plug-in.
(Url should be like this after clicking: demo.com/my_page.php).
I googled it but not found anything understanding some are suggesting templates(I don’t know about them yet).

Will you please suggest me the best way to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:30:09+00:00Added an answer on June 14, 2026 at 5:30 am

    PHP Version 5+

    The first thing to do for the first 2 methods I will describe below, is to create the page in WordPress. Select Pages-> New to create it, with title “my-page” or “My Page”. The slug should be “my-page” in both cases, unless already exists. Don’t use “my_page”.

    There are several ways to manage front-end pages within a plugin.

    The one I like the most is to have the page in the plugin’s directory and then copy it to the theme’s directory, as shown in the following example.

    Create the form as you would do normally and save it at your plugin’s directory.

    This file will be the template for the page in the stylesheet directory. The page must be located in this directory, as far as I know, for WP to load it.

    Example:

    // Make sure you define in your plugin's main script the location of the plugin, with a code like this:
    
    // Holds the absolute path to MyPlugin directory, without slashes.
    if ( !defined( 'MyPlugin_DIR' ) ) define( 'MyPlugin_DIR', __DIR__ );
    
        function CopyFile() {
    
          $TemplateFileSourceURL = MyPlugin_DIR . '/my-page.php'; // Address to your file in the plugin directory
          $TemplateFileTargetURL = get_stylesheet_directory() . '/page-my-page.php'; // Note the "page-" prefix, it is necessary for WP to select this file instead of the general "page.php". The name after the prefix must match the slug of the page created in WP. 
    
          if ( !file_exists( $TemplateFileSourceURL ) ) {
            return FALSE;
          }
    
          $GetTemplate = file_get_contents( $TemplateFileSourceURL );
          if ( !$GetTemplate ) {
            return FALSE;
          }
    
          $WriteTemplate = file_put_contents( $TemplateFileTargetURL, $GetTemplate );
          if ( !$WriteTemplate ) {
            return FALSE;
          }
          return TRUE;
        }
    

    The other method involves creating the page and saving it in the theme’s directory as a template file or just as a page.

    To make it a template, you have to add in the first line the following comment:

    /*
    Template Name: MyPage
    */
    

    MyPage can be any name. Then go to the page editor in WP and select the MyPage template in the right bar. It should be there when you reload the editor’s page.

    You don’t have to make it a template if you add the prefix “page-” to the name of the file in the theme’s directory. i.e. page-my-page.php.

    The last method is to create the file, save it wherever you want and load WP with a code like this in the first lines:

    NOTE: No need to create the page in WP if this method is used, it will do nothing, although you might have to redeclare user’s variables and functions.

    require_once ('WPBlogUrl/wp-load.php'); // Make sure WPBlogUrl points to the blog's url.
    

    Which method is the best one? Depends on your requirements, but if you don’t want to have to add manually the front-end pages in the theme’s directory, I think the first option is the best one.

    Don’t forget to delete the file in the uninstall script when the plugin is deleted.

    Hope this helps.

    Felipe Alameda A.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very new to JQuery and MVC and webdevelopment over all. I'm now trying to
I am very new to WordPress. I have converted a HTML website I created
I am very new to wordpress and I am baffled. I am trying to
I'm having a very simple problem. I'm new to WordPress and I'm trying to
Im very new to WordPress. I was going through Smooth Slider WP Plugin and
I have a Wordpress site that uses a JQuery plugin called Hover-Caption ( https://github.com/coryschires/hover-caption
I am very new to WordPress, and writing a plugin to (ideally) allow our
I've got a wordpress theme that I update very often with new functionality. I've
Very new to XSL (and XML for that matter), but I need to step
I am very new to WordPress, so I would appreciate some help. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.