Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've made my taxonomies and custom post functions filtered and sortable on the wordpress dashboard but I have no idea how to get them to sort and filter on the frontend.

Here is a screenshot of the page in question: http://i.imgur.com/ciUW41d.png and I want it to act like http://www.nintendolife.com/games.

The code I'm using to display the games is as follows

<?php if ( have_posts() ) : ?>
    <header class="page-header">
        <h1 class="page-title">Games Database</h1>
    </header>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <th></th>
        <th><strong>Title</strong></th>
        <th><strong>Platform(s)</strong></th>
        <th><strong>Genre(s)</strong></th>
        <th><strong>Publisher</strong></th>
        <th><strong>Developer</strong></th>
        <th><strong>Score</strong></th>
        <th><strong>Release Date (US)</strong></th>
      </tr>
      <!-- Start the Loop -->
        <?php while ( have_posts() ) : the_post(); ?>
      <!-- Display game and information -->
      <tbody>
      <tr>
        <td><a href="<?php the_permalink(); ?>"><?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'games_database-thumb' ); } ?></a></td>
        <td><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td>
        <td><?php the_terms( $post->ID, 'games_database_game_platform' ,  ' ' ); ?></td>
        <td><?php the_terms( $post->ID, 'games_database_game_genre' ,  ' ' ); ?></td>
        <td><?php echo esc_html( get_post_meta( get_the_ID(), 'game_publisher', true ) ); ?></td>
        <td><?php echo esc_html( get_post_meta( get_the_ID(), 'game_developer', true ) ); ?></td>
        <td><a href="<?php echo esc_html( get_post_meta( get_the_ID(), 'game_review_link', true ) ); ?>"><div class="rating-<?php echo esc_html( get_post_meta( get_the_ID(), 'game_rating', true ) ); ?>"><?php echo esc_html( get_post_meta( get_the_ID(), 'game_rating', true ) ); ?></div></a></td>
        <td><?php echo esc_html( get_post_meta( get_the_ID(), 'game_release', true ) ); ?></td>
      </tr>
      </tbody>
      <?php endwhile; ?>
    </table>

If anyone could help me out or point me in the direction of a solid tutorial that would be awesome.

Also on the following line of code how do I make it so the link ONLY appears if the custom post function has a link entered?

<td><a href="<?php echo esc_html( get_post_meta( get_the_ID(), 'game_review_link', true ) ); ?>"><div class="rating-<?php echo esc_html( get_post_meta( get_the_ID(), 'game_rating', true ) ); ?>"><?php echo esc_html( get_post_meta( get_the_ID(), 'game_rating', true ) ); ?></div></a></td>

Thanks for your time :)

share|improve this question
    
Can no one help? –  Dave Burns Aug 12 '13 at 9:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.