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.

What I'm working on are the pages that you go to after clicking on a custom taxonomy on the front-end. I'm to the point where I've duplicated category.php, renamed it taxonomy-tr_property_region.php so that I can edit how posts with the taxonomy tr_property_region are displayed.

If I understand correctly I need to edit loop.php, but I don't want taxonomy-tr_property_region.php to look the same as taxonomy-language.php is there a way to not use get_template_part( 'loop', 'category' );

Example being I want to change this

get_template_part( 'loop', 'category' );

To be something more like this,

<div>
<?php 
  $loop = whatever replaces get_template_part( 'loop', 'category' ); 
?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

<div class="fullWidthContent">
<div class="trPropSearchHeader">
  <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  <?php $meta = get_post_meta(get_the_ID(), 'rw_propCity', true); echo $meta; ?>
</div>
<div class="trPropSearchThumbnail">
  <?php if ( has_post_thumbnail()) : ?>
    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
      <?php the_post_thumbnail('thumbnail'); ?>
    </a>
  <?php endif; ?>
</div>
<div class="trPropSearchDetailsContainer">          
  <?php $meta = get_post_meta(get_the_ID(), 'rw_propBedrooms', true); echo $meta; ?>
  <?php $meta = get_post_meta(get_the_ID(), 'rw_propBathrooms', true); echo $meta; ?>
  <?php $meta = get_post_meta(get_the_ID(), 'rw_propDesc', true); echo $meta; ?>
</div>
<div class="clear"></div>  
</div>
<?php endwhile; ?>
</div>
share|improve this question

1 Answer 1

up vote 0 down vote accepted

This is how i would do it:
why not just include another loop.php in its place, for example copy loop.category.php, rename it to something like loop-copy.php make your changes to it and call it to the template as <?php get_template_part( 'loop', 'copy' ); ?>.

share|improve this answer
    
thank you, that was exactly what I needed. –  Chuck Jun 21 '11 at 21:21

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.