Is nesting templates possible? If so- how?
-
Hello,
More adventures in using WordPress as a CMS.
In my latest site I have created a page called Approach where I am using a custom template. Within this page I am using Tabber to create three separate tabs that contain content. I am also utilizing the More Fields plugin to create a lot of custom fields.
The issue is this:
Since I am using the More Fields plugin, I have created three separate sub-pages, as children of the Approach page, for each tab to split up the content for user-friendliness for my client. Each one of these sub-pages is using a different More Fields page-type to generate different custom fields. However, I want each one of these sub-pages to actually appear on its parent page Approach as tabs.My thought was to call on each one of these sub-pages and their content within the Approach page’s HTML, and within the Tabber HTML, using PHP similar to this:
<?php $my_id = 67; $page_id_67 = get_page($my_id); $content = $page_id_67->post_content; echo $content; ?>
Each sub-page would be called based on its ID for each tab.
Each sub-page needs its own template as well, since each tab is structured differently in its HTML, which includes PHP calls for the custom fields. I created a separate template for each tab and assigned them in the Attributes section of each sub-page.
Right now, all I can get with this PHP is the post for each sub-page (which I don’t even need because I want the custom fields). I am unable to see any evidence that the sub-page template or any of its HTML is showing up within the other Approach template.
So I ask- is this even possible? So make a template show up within another template by calling a page by its ID? If so- what am I doing wrong? I don’t know PHP, so I could be missing something very important.
Any help would be greatly appreciated.
- The topic ‘Is nesting templates possible? If so- how?’ is closed to new replies.