Sorry for what must be a tiring question. I swear I’ve spent 3+ hours on this already today and I’m asking because I’m out of ideas. I know I’ve gotten it to work in the past where I have used a base-[template-name].php file instead of the default base.php or whatever. But even though I think I have the right files created, it’s still using the default base.php in a specific instance, detailed below.
Basically I have a plugin for ‘calls to action’ that as far as I can tell is just a custom post type of ‘wp-call-to-action’. The plugin outputs an iframe on your page that is supposed to basically contain the output of
the_content() for whatever call to action you select. But what’s happening instead is the whole roots wrapper from base.php, etc. is also being output inside the iframe.
I figured that I could just make a base-[whatever].php file in my theme folder that had no content other than
include roots_template_path(); (i.e it would output no
body or anything) and, as long as I name it correctly, that stripped-down base wrapper will be used and nothing other than
the_content() will be output to the iframe. But it is clearly using the base.php wrapper no matter what I name the other ones I’m putting in there. What am I doing wrong?
Here are some filenames I’ve tried, which did not seem to be used (I know some of these are not really expected to work, but I got desperate and started trying whatever I could think of):
- /base-4470.php (ID of call to action custom post?)
- /base-page-4470.php (same idea)
- /base-page-download-executive-threat-brief.php (slug of call to action custom post?)
- /base-single-wp-call-to-action.php (slug of custom post type?)
I added some code (
echo get_page_template()) to ‘templates/page-header.php’ which supposedly outputs the currently used template’s filename. That said it was using the template ‘/page.php’, so I made a duplicate called ‘/page-4470.php’ and it used that instead. But it’s not wrapping using base-page-4470.php! Shouldn’t it be? I am super confused.
Here is a link to the custom post call to action itself:
When all is working as desired, the only thing you’ll see here is an image, wrapped in a link. But right now, there’s all sorts of other stuff from base.php.
I am hoping that my brain is just fried and I am forgetting something basic. If not, what is goin on? Thanks in advance!
(FYI - this is for a site designed a while back, so it was built off Roots 5.2. In case that matters or there is some known issue that’s been fixed in recent versions. )