ThemeShaper Forums » Thematic

[closed]

conditional statement to use new_category_loop only with custom post types

(2 posts)
  • Started 3 years ago by elderberry
  • Latest reply from elderberry
  • This topic is not resolved
  1. elderberry
    Member

    I modified the thematic_categoryloop with a function to display my custom taxonomies for my custom post type real_estate posts in an archive.

    Now I want to use the original category_loop for other archives. Here's my code, I am sure this is simple, but...noob.

    //New Category Loop
    function new_category_loop() {
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <!-- Display the Title as a link to the Post's permalink. -->
    <h1 class="entry-title">" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h1>
    <div class="entry-meta"><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></div>

    <div class="entry-content">
    <div class="entry-meta">
    <?php echo get_the_term_list( $post->ID, 'rdc_price', 'Price: ', ', ', '' ); ?>
    <?php echo get_the_term_list( $post->ID, 'rdc_contract', 'Contract: ', ', ', '' ); ?>
    <?php echo get_the_term_list( $post->ID, 'rdc_purpose', 'Property Use: ', ', ', '' ); ?>
    <?php echo get_the_term_list( $post->ID, 'rdc_size', 'Size: ', ', ', '' ); ?>
    </div>
    <?php the_excerpt(); ?><hr style="clear : left;">
    </div>
    <!-- Stop The Loop (but note the "else:" - see next line). -->
    <?php endwhile; else: ?>
    <!-- The very first "if" tested to see if there were any Posts to -->
    <!-- display. This "else" part tells what do if there weren't any. -->
    <p>Sorry, no posts matched your criteria.</p>

    <!-- REALLY stop The Loop. -->
    <?php endif;
    wp_tag_cloud( array( 'taxonomy' => 'rdc_purpose' ) ); //show tag cloud after all listings
    }
    add_action('thematic_categoryloop', 'new_category_loop');

    Posted 3 years ago #
  2. elderberry
    Member

    Ok,

    I added this to my function, but the new_category_loop is still being applied to all my post types, not just the real_estate type:

    if ( post_type_exists( 'real_estate' ) ){

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.