Custom Content Type Manager
Trying to use include template path (4 posts)

  1. designisgopdx
    Posted 4 years ago #

    This plugin seems like the perfect one for my use, but I'm having trouble displaying it.

    I created a very simple content type called Home Intro to display an introduction paragraph and place it on my home.php page. However when I use <?php include (TEMPLATEPATH . 'single-home.php'); ?> (single-home.php being the sample template I created to pull onto the homepage), nothing shows up.

    Any ideas or suggestions on how I could include it? I would be doing this frequently on multiple pages.


  2. fireproofsocks
    Plugin Contributor

    Posted 4 years ago #

    I don't think I understand your process here... You shouldn't need to include the "single-home.php" template file like that... if you want content on your home page, then put it on your home page. WP pages can have a dedicated template file, so why not just set up a dedicated theme file for your homepage and put code on that page to display the content you want? I think you're making this more complicated than it needs to be.

  3. designisgopdx
    Posted 4 years ago #

    Yeah, I wanted to use content types in order to limit the area in which someone would be able to make changes to a page.

    My home page is split up into 4 different sections, intro, work, services and contact info, so I wanted to be able to create an area in which one would be able to edit.

  4. fireproofsocks
    Plugin Contributor

    Posted 4 years ago #

    Ok, you could make a custom content type, e.g. with only a title and a content field, then in your dedicated home page theme file use a combination of get_post() and get_post_meta() to retrieve and display the content from those other posts -- it essentially would be displaying one field from each post.

    There's a chapter in my book that talks bout how to do this very thing -- it's quite similar to how MODx handles "Chunks":

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Custom Content Type Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic