Single Page template not working as expected
Permalink 1 user found helpful
Hi all,
I have a single page that I don't want to use my theme's view.php but would rather create a custom template for.
I created a page in my theme of the same name as the single page the contents of which are:
The template is being used instead of view.php - but my single page content is not being output at $innerContent - this variable is an empty string at time of rendering. If I delete the template, view.php renders the single page as expected, I add the template back in and I get nothing.
The page object does exist in the template file,
I just did a fresh install of 5.6.0.2 last night and advanced permissions are enabled. Anyone have any thoughts?
Thanks,
Gerry
I have a single page that I don't want to use my theme's view.php but would rather create a custom template for.
I created a page in my theme of the same name as the single page the contents of which are:
The template is being used instead of view.php - but my single page content is not being output at $innerContent - this variable is an empty string at time of rendering. If I delete the template, view.php renders the single page as expected, I add the template back in and I get nothing.
The page object does exist in the template file,
I just did a fresh install of 5.6.0.2 last night and advanced permissions are enabled. Anyone have any thoughts?
Thanks,
Gerry
Hi Mesuva, I thought that you could override in the theme and it would carry the content from the single page into $innerContent but wasn't certain. Thanks for sorting me out.
Gerry
Gerry
But how do i implement the style? I cant just fill innerContent can i? Do i have to put the single_page in the themes folder?
To explain it another way - an overridden single page is NOT a template/wrapper like view.php, it is both the wrapper as well as the contents of the single page itself.
So as an example.
If your original single page has:
And your theme's view.php has:
When you override the single page by putting it in your theme it would look like: