Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/09/2010, 12:32
juancile
 
Fecha de Ingreso: febrero-2009
Mensajes: 176
Antigüedad: 15 años, 3 meses
Puntos: 1
Categorias Wordpress

Hola Amigos!.
Tengo este codigo para el archivo category.php:

Código PHP:
<?php get_header(); ?>
<div id="border-center-top"></div>
  <div id="content">
  <div id="center">
  <div id="container">
  <div id="center-title">
<h3>Noticias: <?php echo single_cat_title(); ?></h3>
</div>
  <div id="center-left-1">        
        <?php if (have_posts()) : while(have_posts()) : $i++; if(($i 2) == 0) : $wp_query->next_post(); else : the_post(); ?>
  <div class="post" id="post-<?php the_ID(); ?>"> 
  <h1><a href="<?php the_permalink() ?>" rel="bookmark">
  <?php the_title(); ?>
  </a></h1>
  <div class="date">
  <?php the_category(', '?><?php the_time(' | j F Y'); ?>
  </div>
  <a href="<?php the_permalink() ?>" rel="bookmark">
  <?php the_post_thumbnail(array( 120,120 ), array('class' => 'imagen_post')) ?>
  </a>
  <?php the_excerpt(); ?>
  <div class="coments-home">
  <?php comments_popup_link('0 comentarios &raquo;''1 comentario &raquo;''% comentarios &raquo;'); ?>
  </div>
  </div>
<?php endif; endwhile; else: ?>
<div>Alternate content</div>
<?php endif; ?>
</div>
<div id="center-left-2">
<?php $i 0rewind_posts(); ?>
<?php 
if (have_posts()) : while(have_posts()) : $i++; if(($i 2) !== 0) : $wp_query->next_post(); else : the_post(); ?>
  <div class="post" id="post-<?php the_ID(); ?>">
  <h1><a href="<?php the_permalink() ?>" rel="bookmark">
  <?php the_title(); ?>
  </a></h1>
  <div class="date">
  <?php the_category(', '?><?php the_time(' | j F Y'); ?>
  </div>
  <a href="<?php the_permalink() ?>" rel="bookmark">
  <?php the_post_thumbnail(array( 120,120 ), array('class' => 'imagen_post')) ?>
  </a>
  <?php the_excerpt(); ?>
  <div class="coments-home">
  <?php comments_popup_link('0 comentarios &raquo;''1 comentario &raquo;''% comentarios &raquo;'); ?>
  </div>
  </div>
<?php endif; endwhile; else: ?>
<div>Alternate content</div>
<?php endif; ?>
</div>
  <div id="navigation">
   <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } 
            else { 
?>
            <div class="right"><?php next_posts_link('Next Page &raquo;'?></div>
            <div class="left"><?php previous_posts_link('&laquo; Previous Page'?></div>
            <?php ?>
  </div>
</div>
</div>
<?php include (TEMPLATEPATH '/sidebar1.php'); ?>
<?php 
include (TEMPLATEPATH '/sidebar2.php'); ?>
<?php 
include (TEMPLATEPATH '/sidebar3.php'); ?>
<?php 
include (TEMPLATEPATH '/forms.php'); ?>
</div>
<?php get_footer(); ?>
Y le quiero agregar este:

Código PHP:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <?php 
        $id 
get_cat_id('job');
        
$in_subcategory false;
        foreach( 
explode"/"get_category_children$id ) ) as $child_category ) {
        if(
in_category($child_category))$in_subcategory true;
        }        
        if (
$in_subcategory || in_category$id )) {?>
        <div class="the_job">
            <div class="span-6">
                <h3 class="jobtitle"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h3>
                <span class="jobcompany">
                    Company: <strong><?php $jobcompany get_post_custom_values("company"); echo $jobcompany[0]; ?></strong>
                </span>
                <span class="jobaddress">
                    Where: <strong><?php $jobaddress get_post_custom_values("address"); echo $jobaddress[0]; ?></strong>
                </span>
                <p class="jobinfo">
                    Submitted the: <strong><?php the_time('jS F Y'?> <?php // comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></strong>
                </p>
            </div>
            <div class="span-6 last">
                <div class="jobentry entry">
                    <?php the_content('Read more &raquo;'); ?>
                    <?php trackback_rdf(); ?> 
                </div>
            </div>
        </div>
Quiero agregarlo para que cuando una entrada sea etiquetada en la categoria "Job" la muestre de la forma indicada en este ultimo codigo, y si no pertenece a esta categoria la muestre de forma normal, es decir, como el primer codigo.

Como puedo agrupar estos dos codigos?
Gracias!!!