Calling posts by custom taxonomy and not categories

I'm using the content-columns template for the homepage, and I'm displaying posts differently in each column. Currently, the featured content is category1, the left column is category2, the middle category3, the right category4 and the spotlight is category5. What I'd like to do is use a custom taxonomy (genre) to determine what gets displayed in each of these areas, so that I can use and display the categories for further classification.

Any ideas? Thanks!

  • S Silver
    • Flash Drive

    Hi and thanks for the prompt response. I've already created the custom taxonomies. Now I'm just looking to filter posts by it.

    This is all of the current code calling in categories (I've already modified it):

    <?php
    $cat_rows = get_option('dev_buddydaily_featurecat_row_num');
    $cat_one = get_option('dev_buddydaily_featurecat_one');
    $cat_two = get_option('dev_buddydaily_featurecat_two');
    $cat_three = get_option('dev_buddydaily_featurecat_three');
    $cat_image_display = get_option('dev_buddydaily_featurecat_image_size');
    ?>

    <?php

    if (($cat_rows == "")||($cat_rows == "1")):
    ?>
    <div class="column-content">
    <?php if ($cat_one != ""):?>
    <div class="content-block">
    <?php $my_query = new WP_Query('category_name='. $cat_one . '&posts_per_page=12');
    while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID;?>
    <div class="feature-wrap">
    <h3><?php the_category() ?></h3>
    <h4>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></h4>
    <?php global $bp; ?>
    <?php echo get_avatar( get_the_author_id(), '50' ); ?><span class="byline"><?php the_time('M j Y') ?> <?php _e( 'by ', TEMPLATE_DOMAIN ) ?><?php the_author_link(); ?></span>
    " rel="bookmark" title="<?php the_title_attribute(); ?>">
    <?php the_excerpt(); ?>
    " rel="bookmark" title="<?php the_title_attribute(); ?>" class="button"><?php _e( 'more', TEMPLATE_DOMAIN ) ?>
    </div>
    <?php endwhile; ?>
    <ul class="category-preview">
    <?php $my_query = new WP_Query('category_name='. $cat_one . '&posts_per_page=5');
    while ($my_query->have_posts()) : $my_query->the_post();
    if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>

  • " rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?>
  • <?php endwhile; ?>

    </div>

    So should I replace some of the current code with either of these two lines? What exactly should I replace here?

    This is what I was thinking I would have to modify:

    <?php $my_query = new WP_Query('category_name='. $cat_one . '&posts_per_page=5');

    &genre=action

    &taxonomy=genre&term=action

    Also, I'm imagining that I won't be able to control the display of anything in the "Theme Options" area. Is this correct? Is there any way to modify this so that I can select a genre instead?

    Thanks for your help.

  • S Silver
    • Flash Drive

    Okay, thanks. And how would I display posts from a specific genre? Or is "action," in this case, an example of a genre?

    I should just change that one line of code that calls the category to:

    <?php $my_query = new WP_Query('&genre=________ . '&posts_per_page=5');

  • S Silver
    • Flash Drive

    I've tried to change that one particular line and I'm getting this error, which is pretty straightforward:

    Parse error: syntax error, unexpected '=' in /home6/thedaio1/public_html/shadyfacebook/wp-content/themes/bp-daily/library/components/content-columns.php on line 16

    What else do I have to change or remove in order to get this to work?

    Or, would I be better served using the categories as the primary means of organizing content, and using custom taxonomies to further classify? In this case, how could I get a particular taxonomy name to display on the homepage where the category typically would?

    Example:

    <h3><?php the_category() ?></h3>

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.