You will create a page template whose file name is custompage-template.php
here I suppose put in in your plugin dir/views/ folder. Whenever the page whose title is Your Page Name
is visited, the site will render your custom template
add_filter( 'page_template', 'fw_reserve_page_template' );
function fw_reserve_page_template( $page_template )
{
if ( is_page( 'Your Page Name' ) ) {
$page_template = dirname( __FILE__ ) . '/views/custompage-template.php';
}
return $page_template;
}
Put it in your plugin file.
Related Posts:
- Pass PHP variable to javascript
- Creating a WordPress admin page without a menu for a plugin
- Create page when plugin is activated
- Is it possible to upload a template file to a directory that can be used by all themes?
- How can plugins have their own pages?
- Is there any way to get all the name or slug of template parts used in a page?
- Do action only on certain front end pages?
- Register Page Template from Plugin
- Plugin-generated pages use Not Found or Pages Archive templates?
- php page not found for plugin options menu
- Proper way to replace the_content only for pages created by custom plugin
- Show author on every sub-page
- Plugin create pages and use templates
- Custom form not showing in correct place on page
- How do I show content from a plugin using the template the site is currently working with?
- How to dynamically change spots of text in custom page?
- Pass PHP variable to javascript
- Give custom page template a custom post ID
- WordPress Frontend Page using Plugin
- WordPress Product Detail and catalog
- Plugin json page
- How to use custom footer template in a site-plugin?
- Get content and send to 3rd party
- Choose default template for a page with code
- Custom Page Templates for a complex application – code must sit in a plugin and not the Theme
- How to tell which Plugin is displaying?
- Redirect url in plugin to somewhere else?
- How to create a page template using custom plugin
- Meta box not displaying on the plugin page
- How to access the page without registering in wordpress
- How to provide page_template path in custom plugin using WordPress
- How to implement WordPress plugin update that modifies the database?
- WordPress Plugin Development In MVC Architecture, How?
- Customize plugin update “new version is available” text
- category_name not working (not showing up in sql query debug)
- What happens when two plugins have the same 3rd party class included into them?
- add_rewrite_rule, plugin activation and plugin deactivation
- How to handel multiple checkbox field in the admin settings page with Settings API
- Update Multiple Post Meta for the Same Post In One call?
- Allowing Custom Capability to Manage Plugin Options
- wp_insert_user – how to send verification email before logging in
- Custom plugin settings: clicking “save changes” does not display success message
- How to load a new template page according to a particular URL?
- How can I filter blog name?
- Detect if a plugin was included in a certain page
- How to add an attribute to the body tag with a plugin?
- Override the core function locate_template
- Admin page: form with enctype=”multipart/form-data” does not transfer its data
- Set user ID at time of wp_create_user
- What function can I use consistently to escape possible HTML for editing and display?
- First WordPress Plugin – Stat Issues
- Test files for plugin development
- Updating the Drag-To-Share eXtended share URLs?
- Send Custom welcome email to specific user group
- WordPress.org Plugin Directory doesn’t recognise screenshots [closed]
- How to check current user before all actions and filters?
- Is it necessary to auto delete my WP plugin database tables when users deactivate/delete my plugin?
- Namespaced shortcode?
- How to pass variables to a function argument using add_action [duplicate]
- Custom post types – remove default post supports through empty array?
- How to insert and call new data in wordpress website database through a plugin
- How to be escape Variables and options when echo?
- Release the plugin in the WordPress repository where redux is used
- Dokan Marketplace store link in single product page
- Development of plugins to add components like JqueryUI
- Using meta_query in a WP_Query not working for numbers properly
- why the wp_register_script doesn’t work for register_activation_hook
- Pull comments from one page/post into another page/post?
- Use a custom block in another block
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- GitHub plugins safe to use in my website?
- How to copy the all WordPress media items to another custom plugin folder?
- Personality quiz in wordpress using a plugin
- How can we get this dynamically as this folder may not be by the same name always → wp-admin
- Why is my shortcode not working?
- Link custom post type to page
- implement checkbox or toggle switch in plugin code
- wp_remote_post To external API multiple values with the same key
- wordpress form not saving or updating
- Can we rename a plugin directory for a already launched plugin?
- How can I call functions from a custom plugin?
- How to get short description under heading – Visual Composer [closed]
- Wordress admin page is fetching error You do not have sufficient permissions to access this page.
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- How to create a new database table whenever user changes options
- Am I correctly adding styles to plugin?
- How can I insert a record into a custom table from my custom form in my custom admin page?
- how to create table during plugin installation in side a class
- WP_Filesystem usage within a block of code
- Why function hooked using object are executing at all time?
- Create a blank admin page from plugin
- What is the Object for WP_Error Class?
- How can I use multi Media Uploader in a plugin?
- How to make only selected posts appear on a selected wordpress page
- Gutenberg: Dynamic Block – Show saved data in the editor
- Any way to hook into WP after a page displays?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table
- plugin doesn’t retrieve data from database