Forums

Question about Custom Post Types and Taxonomies (3 posts)

  1. themoviemark
    Member
    Posted 8 months ago #

    I'm currently re-designing my movie website from a custom-designed page to one that uses WordPress. I think in the long run using WordPress will save me a lot of headaches. But in the short run, it's causing a few! Here's one thing I'm still struggling with. I'm trying to use custom post types and taxonomies as the framework for my movie reviews. But I'm not able to display them the way I'd like. For example, here's what the custom-designed site looks like using .NET and displaying the reviews in a gridview:

    http://www.themoviemark.com/Reviews/MovieReviews/Default.aspx

    I want to create a similar listing of reviews in WordPress. Basically, here's what I have after creating one review using custom post types and taxonomies:

    http://www.themoviemark.com/blog/index.php/reviews/movie-reviews/

    Here's the code I'm using to display the taxonomies and the review:

    <?php $loop = new WP_Query( array( 'post_type' => 'movie-review', 'posts_per_page' => 10 ) ); ?>
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?>

    <?php echo get_the_term_list( $post->ID, 'genre', 'Genres: ', ', ', '' ); ?>
    <div>
    <?php the_content(); ?>
    </div>
    <?php endwhile; ?>

    I don't know why it's posting the review twice. But what do I do if instead of showing the entire content I want to show a list of review titles and then a reader can click on the movie title and open up a page for a specific movie review?

    Also, I would think that clicking on the "Comedy" and "Drama" taxonomies would show "Akeelah and the Bee" under their pages, but instead they show "No posts found."

    I think I'm getting close to building the page I want, but there are a few hurdles like the ones above that I need to jump. I would appreciate any help, tips, advice that anybody can give me. And please let me know if anything needs clarification.

    TMM

  2. fonglh
    Member
    Posted 8 months ago #

    I can answer this one.

    But what do I do if instead of showing the entire content I want to show a list of review titles and then a reader can click on the movie title and open up a page for a specific movie review?

    Just take out the_content(). And check out the_permalink().

    http://codex.wordpress.org/Function_Reference/the_permalink

  3. themoviemark
    Member
    Posted 8 months ago #

    Thanks, I got that working. Now I just need to work on formatting it the way I want it. Unfortunately, when I click on "Comedy" and "Drama"
    it gives me the "No posts found" message even though I have assigned those taxonomies to the movie.

    Any suggestions on what I need to be looking for in regard to that?

Reply

You must log in to post.

About this Topic