Page not rendering in custom post type using template
-
Hi,
Thanks for your plugin, it seems to be just what I’m after, but I’m having an issue I am hoping you can help me with.
I have had success with the plugin on a regular page post type.
I created a page called ‘new-content-to-pull’.
Within the regular page post types text editor I added in shortcodes for testing.
PREVIEW
On the front end, it worked fine.
PREVIEWI need to use a template file to display the other page’s content.
So I created a template file and added in the required code to display the fields etc.
PREVIEWThis worked on the front end.
PREVIEWInterestingly though, I couldn’t use the following together.
[insert page=’new-content-to-pull’ display=’views/template-test.blade.php’]
[insert page=’new-content-to-pull’ display=’title’] (or link, all etc)As it would only display the template and not the title or link, all etc.
Not certain if by design or a bug. Anyway…I mostly need this insert page functionality for use in a Custom Post Type.
But I couldn’t seem to get it working. I repeated the following steps.Created a page within the ‘Landing Page (landing)’ Custom Post Type.
Added in the saem stuff.
PREVIEWIt again worked on the front end.
PREVIEWI changed the output to use a template file instead.
PREVIEWUnfortunately, it doesn’t render on the front end at all.
I just get an empty div with no content.
PREVIEWIt doesn’t even show up the hard coded test text within the template file ‘This text is being pulled from within template-test.blade.php’
So it doesn’t seem to be anything to do with not having the loop right or the fields correct etc.Any ideas where I am going wrong? Your help would be much appreciated.
Cheers.
Sorry for my previous post to the support forum, which I tried to remove.
I was having a similar issue where only the DIV would show up, but it was because I was trying to call a shortcode within an ACF text field, but I had to enable ACF text fields to allow rendering of shortcodes.
- The topic ‘Page not rendering in custom post type using template’ is closed to new replies.