Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/06/2010, 10:35
sabogal
 
Fecha de Ingreso: mayo-2009
Mensajes: 23
Antigüedad: 15 años
Puntos: 1
Respuesta: Listar últimos post de la categoría a la que pertenece el post

Parece que he encontrado el código que hace lo que necesito pero me genera un error al final:
Código PHP:
<?php //begin sidebar  ?>
<div id="sidebar">


 <div class="enews">

 <?php
if ( is_category() ) :
global 
$post;
$categories get_the_category();
foreach (
$categories as $category) :
$posts get_posts('numberposts=4&exclude=' $GLOBALS['current_id'] . '&category='$category->term_id);
//To change the number of posts, edit the 'numberposts' parameter above
if(count($posts) > 1) {
?>

<h4 class="widgettitle">More in <?php echo $category->name?></h3>
<ul>
<?php foreach($posts as $post) : ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>

<?php ?>

 </div>
 
</div>

<?php //end sidebar  ?>
Parece que faltara un endif pero lo coloco y el error continúa.

Saludos!