Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/11/2010, 14:42
pleter
 
Fecha de Ingreso: julio-2009
Ubicación: Argentinalandia
Mensajes: 339
Antigüedad: 14 años, 10 meses
Puntos: 15
Me da error con Post Aleatorios (dice que falta "=")

Buenos dias.

Queria mostrar mis post de forma aleatoria pero tengo un problema, no puedo hacerlo ya que me da error (dice que falta un signo igual "=")
pero revise la sintaxis y no le veo error (guarda! no soy un experto, apenas lo mas basico de lo basico)

el original es asi:

Código PHP:
<div id="recent-posts" class="clearfix">    
            <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
                <?php include(TEMPLATEPATH '/includes/entry.php'); ?>
            <?php endwhile; ?>

                <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
                    else { 
?>
                        <?php include(TEMPLATEPATH '/includes/navigation.php'); ?>
                <?php ?>

            <?php else : ?>
                <?php include(TEMPLATEPATH '/includes/no-results.php'); ?>
            <?php endif; wp_reset_query(); ?>        
    
</div>
el cual modifico y me queda asi:

Código PHP:
<div id="recent-posts" class="clearfix">    
            <?php $posts=query_posts($query_string ‘orderby=rand’); if (have_posts()) : while (have_posts()) : the_post(); ?>
                <?php include(TEMPLATEPATH '/includes/entry.php'); ?>
            <?php endwhile; ?>

                <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
                    else { 
?>
                        <?php include(TEMPLATEPATH '/includes/navigation.php'); ?>
                <?php ?>

            <?php else : ?>
                <?php include(TEMPLATEPATH '/includes/no-results.php'); ?>
            <?php endif; wp_reset_query(); ?>        
    
</div>

Claramente reemplazo:
Código:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
por
Código:
<?php $posts=query_posts($query_string . ‘orderby=rand’); if (have_posts()) : while (have_posts()) : the_post(); ?>
pero me da error en esa linea (diciendo que falta "=")

-------------
para los que no sepan, les dejo las 3 formas de mostrar:


* Aleatorio:

<?php $posts=query_posts($query_string . ‘orderby=rand’); if (have_posts()) : while (have_posts()) : the_post(); ?>

* Ascendente:

<?php $posts=query_posts($query_string . ‘&order=asc’); if (have_posts()) : while (have_posts()) : the_post(); ?>

* Descendente: ( default )

<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?>
__________________
Mi Perfil y Blog estan en Yeow.com.ar ✰✰✰✰✰
Pero en WONDED.COM estan Mis Proyectos OpenSource ;-)