Themes

Hi
I started to use custompress now I have an extra single.php template for my new custom post but I also need archieve.php, search.php and index.php for this custom post.
How can I use this extra theme files?

  • Kimberly

    zippro

    Hi and Thanks for using WPMUdev forums!

    There is some great information on what you are trying to do here:
    http://codex.wordpress.org/Post_Types

    I'll excerpt some :slight_smile:

    Single template

    In the form of the single-type-template. In the same way that posts are shown on their own page with single.php, custom post types will use single-{posttype}.php if it's available.

    So for the above example, you could create a single-acme_product.php file and the product posts would be shown using that template.

    Archive template

    In the form of the archive-type-template. In the same way that posts are shown on their own archive with archive.php, custom post types will use archive-{posttype}.php if it's available.

    So for the above example, you could create a archive-acme_product.php file and the product posts would be shown using that template.

    Note: Use the is_post_type_archive() function to check if the query shows post type archive page, and the post_type_archive_title() to echo the post type title.

    You can create what you need. Please don't hesitate to know if I missed the boat on this!

    Best,

    Kimberly


    If this thread is not resolved because the suggested action did not work or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.