Ver Mensaje Individual
  #9 (permalink)  
Antiguo 09/09/2010, 10:43
American2010
 
Fecha de Ingreso: abril-2003
Mensajes: 1.129
Antigüedad: 21 años
Puntos: 34
Respuesta: Categorias Wordpress

La idea sería esta, pero a ver si te podes pasar por el Foro de PHP porque no termino de entender donde está el error, entre PHP y el codigo de WP algun if o while esta molestando y no se como resolverlo...

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 $id get_cat_id('Job'); echo single_cat_title(); ?></h3>
</div>

<?php if ($id=="10") { //Cambiar ese 10 por el ID de la categoría Job en tu WP // ?>



<div id="center-left-1">
<?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>
<?php ?>

</div>

<?php } else { ?>

  <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>

<?php ?>

  <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(); ?>
Los errores ya están en tu segundo código, que no tiene cerrados los if. No se como se cierran, ese formato de if, while y demás con los : nunca los entendí.
__________________
elGastronomo