Foros del Web » Creando para Internet » Sistemas de gestión de contenidos » WordPress »

[problema] The loop

Estas en el tema de [problema] The loop en el foro de WordPress en Foros del Web. Hola, ando con un problema en el cual necesito listar una categoria especifica de mi wp en una pagina. Utilizo EXEC-php de plugin para correr ...
  #1 (permalink)  
Antiguo 28/01/2008, 12:09
Avatar de seinkraft  
Fecha de Ingreso: diciembre-2007
Mensajes: 119
Antigüedad: 16 años, 4 meses
Puntos: 1
[problema] The loop

Hola, ando con un problema en el cual necesito listar una categoria especifica de mi wp en una pagina. Utilizo EXEC-php de plugin para correr php en los posts pero no logo ejecutar el siguiente script que es ejemplo en la documentacion de wp.
http://codex.wordpress.org/The_Loop

Intente todo, sin embargo me dice que no existe la categoria y el llop no se detiene imprimiendo el mensaje n cantidad de veces.

Código PHP:
<!-- Start the Loop. -->
 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

 <!-- The following tests if the current post is in category 3. -->
 <!-- If it is, the div box is given the CSS class "post-cat-three". -->
 <!-- Otherwise, the div box will be given the CSS class "post". -->
 <?php if ( in_category('3') ) { ?>
           <div class="post-cat-three">
 <?php } else { ?>
           <div class="post">
 <?php ?>

 <!-- Display the Title as a link to the Post's permalink. -->
 <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>

 <!-- Display the Time. -->
 <small><?php the_time('F jS, Y'); ?></small>

 <!-- Display the Post's Content in a div box. -->
 <div class="entry">
   <?php the_content(); ?>
 </div>

 <!-- Display a comma separated list of the Post's Categories. -->
 <p class="postmetadata">Posted in <?php the_category(', '); ?></p>
 </div> <!-- closes the first div box -->

 <!-- 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; ?>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:47.