CustomPress post type not using single-template

I'm using the CustomPress plugin and have a custom post type called directory_entry. I have created the php template called "single-directory_entry.php" however whenever one of these post types is viewed it's using index.php instead of single-directory_entry.php like I would expect. How do I resolve this issue?

  • canfp
    • Flash Drive

    Hi Tom -

    The template I've created is for post types (single-directory_entry.php) so it's not available for selection when creating or editing a page. I believe that's the correct behavior.

    As you probably know there is no ability to select a template on an individual post with CustomPress. Instead I understand it uses the wordpress template hierarchy (http://codex.wordpress.org/Template_Hierarchy) to select the single-custom_post_type.php template which has been created but is not being used. That's my problem - why is it not using the template?

    Thanks, Dylan

  • redpupmedia
    • Design Lord, Child of Thor

    Found a resolution for custom taxonomies.
    Name the page template file taxonomy-$taxonomy.php

    For a custom Post-Type, it should be archive-$posttype.php
    But the Directory plugin accomplishes this with page-listings.php 'listings' is the Capability Type set for the Custom Post Type. But this template file is buried in the plugin and I can see how they call it. Also, even though that is the template affecting the page content, WordPress thinks it's using page.php

    Staff? Is any of this correct? Helpful?

  • redpupmedia
    • Design Lord, Child of Thor

    almost....
    goal: list of locations, with a list of people at each location that can be filtered by skill (tag or category).

    The creation of a page template for the taxonomy works. The taxlonomy is 'listing_location' and the page template being used is taxonomy-listing_location.php.

    Where I'm stuck now is being able to display only the skills (tags or categories) that are at a specific location (taxonomy). I think it's in here:
    $categories_list = get_the_category_list( __(', ',DR_TEXT_DOMAIN),'');
    but I can make the displayed categories limited to the location we are currently viewing. I feel like I'm missing a level of nesting...

  • Arnold
    • El Macho WP

    single-post_type.php should work. I do it all the time. The file should be in your theme or child theme directory.

    The Directory plugin isn't a good example to follow because when it was written it did it's own things on naming.

    What does it show when you try to use it? It might be your theme. Have you tried it with a standard theme like 2012?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.