Alright, so I’ve previously developed a plugin that allows me to communicate with the Stripe API to do some membership/purchase related things on my WordPress site. I’m fairly new to sage so I’m just wondering what the best practice is to get a partial template (loaded from a plugin) to fit most themes.
So my plugin creates a custom post type called ‘membership’ to store data from Stripe and then I have a filter added to look for single post types with type of ‘membership’ to load a Partial template into WordPress. Lets call this template single-membership.php.
Normally I would just call template_get_part(‘template_part’); to get the relevant pieces of the theme I needed. Something like:
single-membership.php
<?php
get_template_part('header');
include('main-content-file-membership.php');
get_template_part('footer';)
?>
However, with Sage, since it uses Blade, I get an error like this:
Theme without header.php is <strong>deprecated</strong> since version 3.0.0 with no alternative available. Please include a header.php template in your theme. in C:\dev\sites\palmtree.studios.local\bedrock\web\wp\wp-includes\functions.php on line 3984
Maybe I’m not thinking about this correctly, I just want the plugin template to fit most themes. I realize every theme is different, but I was hoping to at least get some nav elements and wp_head loaded with the footer just for some basic styling and cohesiveness across the site.
Any advice is much appreciated.