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
- Change plugin main file name (that is currently in the repo)
- Create dynamic page content from custom WordPress plugin page
- Plugin Options Not Saving to Database in WP 4.5
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- How to create ‘import dummy data’ option in custom wordpress plugin
- Call to a member function have_posts() on a non-object on normal loop
- JS Support Ticket – Auto create WP account
- WP Post Template – Templates in own folder
- Private Plugin Updates – Localhost
- How to change custom post type pemalink Hierarcy
- Any hook for pre-plugin-update -either bulk or single plugin update
- Get plugin option in another PHP file
- wp_create_nonce function doesn’t work inside a plugin?
- Test files for plugin development
- Input with spaces in Shortcode attributes overwritten by defaults
- Unable to override pluggable function wp_mail
- Avoid class name collision when using third party libraries in plugins?
- How to create custom tables in WordPress using my own plugin?
- New User Form – Custom Menu Page
- Own plugin corrups plugin-activation
- wordpress plugin is not activating from widget
- All Users > User List > Update User Meta Field Inline
- Checking instances of scripts in wp_head
- How to save post change url youtube link?
- Best approach to fetch data from wp options to js file or php file
- Correct way to perform non-cacheable DB query
- Allow users of my plugin to define their own shortcode rather than use mine?
- Is it possible to create Custom Post plug-in?
- uninstall.php file in Plugin to clean DB
- Archive – same title for the first two posts
- Creating a plugin to sanitize comment and the url field before display only
- Edit Yoast SEO breadcrumbs output [closed]
- Creating plugin using simple_html_dom parser?
- Object Oriented Plugin not working
- Does WP identify plugin by plugin name or plugin_basename?
- switched from query_posts to WP_query, not working now?
- Making a plugin only available on the front-end for the logged in super admin
- Create entire wordpress as a github repositery?
- Help With MySQL to WPDB Query Conversion
- When to load auto-login code?
- AJAX search posts and pages
- How to find the origin of a file upload from within wp_handle_upload?
- How would I go about creating a user ranked post popularity page?
- CSV file generation failing
- Updating the Drag-To-Share eXtended share URLs?
- finding whether request is for post, and post id
- Building plugin with changeable custom post type values…advice needed
- How to get all of the activate_plugin action parameters?
- __callStatic method handler passed to add_action causes bug in PHP
- Enqueue WordPress plugin scripts below all other JS
- Display update notification messages like ‘What’s New’
- How to add Internationalization in WordPress using Javascript/React?
- CRUD and Frontend show from a custom table without shortcode
- How to get specific setting by settings_fields()?
- Save / Show multi line text in metabox
- Creating mySQL procedure with $wpdb
- how to disable blockrenderAppender inside all Innerblocks?
- why doesn’t this update part of this plugin work? it take me to nothing here page
- Redirection of users away from wp-admin (but not administrators)
- WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal
- Using a custom plugin to capture input data via Ajax and PHP
- Python with wordpress plugin
- Display post lists in 2nd paragraph
- Map Custom Registration Fields to WordPress User Roles
- Not able to add option in Sub-Menu under page
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- How to apply a patch via plugin?
- Fixing WordPress’s Bug (failed to send buffer of zlib output compression) results in “White Screen of Death”