Grow your CSS skills. Land your dream job.

Custom post types and Categories/Tags

  • # July 14, 2010 at 4:03 am

    I’ve created a custom post type called "Shoes", and I’ve allowed users to tag and categorize the shoe posts. The only problem is when I click on the tag or category that is dynamically added under the Shoe article (Like a normal post) it links me to a tag or category page without any shoes being displayed.

    So basically, it only displays posts that are published under the default wordpress ‘Posts’ page (In the backend).

    Does anyone have any ideas on how to go about displaying the ‘Shoes’ posts labeled with these tags aswell?

    This is the ‘shoes’ code under my functions.php, I’m not sure if it is of any use or not:

    Code:
    function create_my_post_types() {
    register_post_type( ‘shoe’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Shoes’ ),
    ‘singular_name’ => __( ‘Shoe’ ),
    ),
    ‘_builtin’ => false,
    ‘public’ => true,
    ‘hierarchical’ => false,
    ‘taxonomies’ => array( ‘category’, ‘post_tag’),
    ‘supports’ => array(‘title’,’editor’,’author’,’thumbnail’,’excerpt’,’comments’
    ),
    ‘rewrite’ => array( ‘slug’ => ‘shoe’, ‘with_front’ => false ),
    )
    );
    }
    add_action( ‘init’, ‘create_my_post_types’ );
    # July 15, 2010 at 10:31 am

    I’ve found a solution, but if anyone finds an answer to this, please let me know.
    I’ve noticed that this problem doesn’t occur with custom taxonomies, only the default post-tags and categories. So I’ve created a custom taxonomy and named it ‘Tags’ :lol:

    # July 15, 2010 at 12:21 pm

    Hmmmmm, I feel like you’re just missing a step, but I haven’t run into this myself yet so I can’t help you. I’ll see what happens as I do more work with 3.0.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".