WordPress.org

Ready to get started?Download WordPress

Forums

Simple Custom Post Type Archives
ignores my type-(custom-post-type)t.php file completely (11 posts)

  1. ashbryant
    Member
    Posted 3 years ago #

    Hi,

    I'm having a bit of an issue with this. I have just started on custom post types & quickly ran in to the problem which your plugin has set out to fix.

    But when I activate your plugin it does list out the posts, but I can't seem to override the template being used.

    Now it might not be anything to do with your plugin, as I'm using the new Twenty Ten theme as a test bed for my play with custom post types, but I would be grateful for any help you could offer.

    I have a url structure of http://test.com/product/a-bag-of-crisps/ & when I go to http://test.com/product/ it lists the posts, but ignores my type-product.php file completely.

    Ash

    http://wordpress.org/extend/plugins/simple-custom-post-type-archives/

  2. Jake Goldman
    10up Engineer
    Plugin Author

    Posted 3 years ago #

    Let me know if 0.8.5 fixes this for you!

  3. pescadito01
    Member
    Posted 3 years ago #

    hi,
    i tried you plugin without succefull and i have some questions to do:

    1) i use wp30 and more field and/or magic field plugins to create custom post types, are this plugins compatible with yours?

    2) suppose i have movie as custom post type, when you create type-movie.php and single-movie.php, do you need to add
    <?php
    Template Name: type-movie
    */
    ?>
    before get_header() ?

    3) after that how do you address the custom post type collection (archive) for the new templates?
    - http://myblog.com/?post_type=movie
    - http://myblog.com/movie
    - or something else??

    best regard, pescadito

  4. loremipsum
    Member
    Posted 3 years ago #

    Same problem here. type-projects.php is ignored, although type.php works (which is useless since I have more than one custom post type). I'm using v 0.8.5.

    Please help.

  5. Jake Goldman
    10up Engineer
    Plugin Author

    Posted 3 years ago #

    I think the confusion is coming from the naming of the template file.

    Remember - you need to use the post type *name* (the first parameter in register_post_type), not the slug in your template file. To mitigate confusion, I'll probably add support for type-slug.php in the next update.

    pescadito01 - this plug-in is built to work with WordPress 3.0's native "register_post_type" functionality. Plug-ins like Custom Post Type UI are a wrapper for this functionality. It is not tested with nor built for plug-ins that have their own custom post type implementation.

  6. hallenberg
    Member
    Posted 3 years ago #

    Thanks for your work.. One request:

    is_scpta_post_type($post_type)

    For me this causes a warning whenever $post_type happens to be an array. I'd be grateful if arrays could be ignored :)

  7. hallenberg
    Member
    Posted 3 years ago #

    ..um, also..

    add_filter( 'wp_title', 'scpta_wp_title', 10, 3 )

    Could it be that the priority of 10 here needs to be elevated in order to allow the blog name to be appended to the title by WordPress later in the process?

  8. Jake Goldman
    10up Engineer
    Plugin Author

    Posted 3 years ago #

    Hallenberg - given the way built in post types work, I'm not sure why the post type - as passed to that function - would ever be an array. Can you explain why this would even happen? The check is easy enough, but I'd like to understand before I add any excess weight to the plugin.

    I don't follow your question about the title, though I do think I should probably elevate the priority for a variety of reasons. Are you using a plugin or your own filter that tacks on the blog name? That's not done by default...

  9. hallenberg
    Member
    Posted 3 years ago #

    Hi Jake..

    Example post_type as array:
    query_posts( array( 'post_type' => array('post', 'movie') ) );

    I lifted the line above directly from WP Codex examples here. (In this example 'movie' happens to be a custom post type).

    Re the title.. I am using a couple of select plugins but none should be interfering with the title in any way. It appears to me that the blog name ordinarily gets included in all titles by default..? For me, the only pages it wasn't appearing on were the custom post type archive pages...until I elevated your priority setting.

  10. loremipsum
    Member
    Posted 3 years ago #

    I believe I am using post type *name*. The name of my post type is "projects" (same as the slug), so I'm using type-projects.php.

    Also, how can I add custom archive support for the following setup?
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

  11. ThemeMee
    Member
    Posted 3 years ago #

    (I'm probably missing something, but...) For the page title, all I was getting was the custom post type's label. For SEO, it would be better to have control of the page title. While I'm not at all sure if this is correct, I changed line 135 from:

    $title = $post_type->label;

    to

    $title = get_bloginfo('name').' - '.$post_type->label;

    This works to at least put the site's name first. Is there a better way to control the CPT's page title? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic