Include PHP Shortcode – wordpress plugin
This will create a shortcode called [template] that you can use in your WordPress posts and pages.
The shortcode takes an attribute called file, which specifies the name of the PHP file you want to include.
For example, if you want to include a file called custom-template.php, you would use the shortcode like this: [template file=”custom-template”].
You can then use this shortcode to include any PHP file from your template directory in your WordPress posts or pages.