How to use custom footer template in a site-plugin?

You cannot override header / footer templates from a plugin, you’ll have to change the theme. theme_page_templates can be used to change the general template for the post type page. That template then uses get_header() and get_footer(), which in turn include header.php / footer.php (optionally header-$name.php, if a parameter has been passed to get_header(), same … Read more

How to Maintain url on form submit

If your form is embedded in a shortcode or some other front end form, I would post to the permalink for the page. That’s more reliable than using action=”” in my experience. Then output something on that page to acknowledge the submission or show an error. $global $post; printf(‘<form method=”post” action=”%s”>’,get_permalink($post->ID)); or in for a … Read more

How can I load Template file from wordpress plugin

You can check below code : change Page slug “gym-dashboard” as per your requirement. <?php function rt_include_gym_dashboard_page_template( $template ) { if ( is_page( ‘gym-dashboard’ ) ) { return plugin_dir_path( __FILE__ ) . ‘templates/content-gym-dashboard.php’; } return $template; } add_filter( ‘template_include’, ‘rt_include_gym_dashboard_page_template’, 99 );