Forums

Custom Post Types: Archive Page, and different Single Page (6 posts)

  1. erick_paper
    Member
    Posted 1 year ago #

    After all the brouhaha about WP getting custom posts types and growing up as a CMS, I see it's still far from having a user friendly interface to actually use this functionality.

    1. Where and with what scientific intervention or PHD do I need to create a different archive for different custom post types? Without the use of a plugin please. Is this possible? My custom post types (sadly created using a plugin! -- Custom Post UI -- because WP does not have any human way of creating Custom Post types without tinkering with buggy edits to functions.php) are all there and have "Has Archive" set to TRUE. Now what -- how do I design a template for the archive of this? Especially with custom fields showing in there (beyond title, body, excerpt).

    2. Secondly, in the "Single.php" -- can I have "single-cpt1.php", "single-cpt2.php" etc and WP will automatically show the single template based on which custom post it is showing currently?

    Would appreciate any real, specific, latest pointers. Google shows me a bunch of different plugins and idiotic blog posts from people tinkering with code in highly inelegant and unsatisfying ways.

    Thanks!

  2. curtismchale
    Member
    Posted 1 year ago #

    I think you're going to be disappointed. Making archive pages for CPT's requires getting in to code, there is no WYSIWYG functionality for building a CPT archive page and it's unlikely there ever will be. You might be able to come up with something from a premium theme like Headway but that's about the closest you're going to get.

  3. erick_paper
    Member
    Posted 1 year ago #

    OK. In that case, at least there can be some sensible way to code them?

    For example, why can't I just do category pages like this:

    category-cpt1.php
    category-cpt2.php
    ..etc.

    And single pages with a similar naming convention:

    single.php (default)
    single-cpt1.php
    single-cpt2.php

    If this is not possible either, where are the straightforward instructions from WORDPRESS formally (not a gazillion rambling blogs) to get different custom post types to show up differently on the user interface side?

    Thanks for your help!

  4. erick_paper
    Member
    Posted 1 year ago #

    Any ideas?

  5. erick_paper
    Member
    Posted 1 year ago #

    Nothing? No help? For all the talk and banter about this new WordPress capability?

    I have been unable to find something on WP's own website.

    Would appreciate any pointers.

    Thanks.

  6. curtismchale
    Member
    Posted 1 year ago #

    Your probably looking for the archive-cpt.php template and the single-cpt.php templates. View the WordPress template hierarchy to see the full scheme of how page templates cascade.

    http://codex.wordpress.org/Template_Hierarchy

    You could probably also setup an if else statement that handled all the post type views you wanted using the is_post_type_archive() and get_post_type() conditionals.

    http://codex.wordpress.org/Conditional_Tags

Topic Closed

This topic has been closed to new replies.

About this Topic