This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

problem showing custom post types

  • Creator
    Topic
  • #8875
    virgodesign
    Participant

    Hi,
    I’ve a problem showing custom post types in poost list or post grid layout.

    In short:
    I’ve installed wordpress 3.5.1 with last version fo barely corporate.
    I’ve created a post category, “people”.
    I’ve create 2 new posts added to this category.
    After that I’ve installed types plugin for creating and managing custom post types. I’ve created my personal post type “Women” and added one of these custom posts to “people” category.
    I’ve created a page with post list (or post grid) layout to show all posts (custom and not) with “people” category.

    Custom post types are not shown in frontend.
    Someone know how to fix this, or wich is the correct way to show custom posts?

    thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #8883
    Jason Bobich
    Keymaster

    Hello,

    You’re not going to be able to show the custom post type with using those default category options of the post grid/post list. The reason is because any time you setup a secondary, custom query of posts, which is what’s happening with these elements, WordPress always has the post_type parameter set to “post” unless you feed in something different. — “post” is WordPress’s default post type.

    You can achieve what you want, but you need to use the “Custom Query” option of the element for setting up your post grids or post lists. When you do this, any of the query-related options prior no longer have any effect. — i.e. category selection, order of posts, etc — Now, these need be done with your custom query.

    http://codex.wordpress.org/Class_Reference/WP_Query

    How you setup this custom query kind of depends on the specifics of what you’re doing. So, assuming that you are sure you’ve attached the default WP taxonomy “Categories” to this post type, here’s one way you could target these posts:

    post_type=women&category_name=people

    And if you wanted to pull all posts from the “people” category, no matter the post type as you eluded to above, you could do this:

    post_type=any&category_name=people

    Note: In these two examples, I’m using the “slugs” of the post type and category.

    Does that make sense?

    #8892
    virgodesign
    Participant

    Ok,
    I’m not so practice about that, But as possible, I’ll do some tries.
    Thank you very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The forum ‘Barely Corporate Responsive WordPress Theme’ is closed to new topics and replies.