ThemeShaper Forums » Thematic

[closed]

custom post type listing

(2 posts)
  • Started 12 years ago by kanariezwart
  • Latest reply from Thompson
  • This topic is not resolved

Tags:

  1. kanariezwart
    Member

    Hi all,

    I've got a thematic WP setup. I'm trying to get a custom post type (CTP) listing but so far no luck.

    Say for example, i've got a website named example.com, created a CTP named 'movies' and want to show listing of movie posts just like regular blogroll on a custom page.

    example.com/movies/movie-title (works!)
    example.com/movies -> list of last n movie entries (doesn't work)

    - registered my CTP in functions
    - created a page in WP admin (named movies)
    - created a page-movies.php for custom listing (or should this

    But still I can't seem to get a listing of the last n movies in my example.com/movies

    Can someone help me out with some tips on thematic_categoryloop() in my custom page-movies.php how to list only my CTP? Or point me in the right direction?

    Thanks in advance!

    Kanariezwart

    Posted 12 years ago #
  2. Thompson
    Member

    I'd recommend using CMS Press to create the custom post type. It will auto create the template to display only movies at /movies/, which I believe is what you're talking about. The only thing it's missing is standard tag & category support, but Michael Pretty, the author says that's on the roadmap (though that was two months ago now, so who knows when it'll be upated). You can create custom taxonomies with it. Oh and you might want to think about registering your CPT as 'movie' singular, b/c that is inline with existing way that WordPress does it (e.g. 'post' 'page')

    A good snippet if you want to add your CPT to your homepage & feed. From: http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page
    function my_get_posts( $query ) {
    if ( ( is_home() && false == $query->query_vars['suppress_filters'] ) || is_feed() )
    $query->set( 'post_type', array( 'post', 'movie' ));
    return $query;
    }
    add_filter( 'pre_get_posts', 'my_get_posts' );

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.