Hello, I’m working on a custom plugin that essentially will generate pages on the fly for us and take parts of the URL to generate the right data.
For example: the permalink /mmr/september2019 would trigger this plugin because it starts with “/mmr/” … The plugin would take that “september2019” and use it to generate the correct information to display on the page.
From there, I want the page to pull in the X theme’s default template for our site and place the generated content inside the template.
public function virtualMmrPage(){
global $wp;
if(strpos($wp->request, "mmr") === 0){
// include get_template("layout-full-width");
require_once( get_template_directory() . "/framework/functions/setup.php");
$template = locate_template(array("template-layout-full-width.php"));
include $template;
die;
}
}
This is the function I’m running on “parse_request” but I just get errors about undefined x_blahblah() functions… Starting with x_masthead_class()
Any idea what I need to do to make this work with the X theme?