Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    da Cronologico a Random

    Un aiutino per favore...

    Attualmente la query dei post prende 5 articoli in ordine cronologico (per data).

    Io vorrei che prendesse in Random i 5 articoli..... Come posso fare? Sulla base del seguente codice??

    Codice PHP:
            <?php 

                    $otherFeaturedPost 
    = new WP_Query();
                
    $otherFeaturedPost->query('showposts=5&cat='.get_option('top-news-category').'&offset=0'); 
                    
    //query_posts('showposts=3&cat='.get_option('lhbox').'&offset=0');
           
    while ($otherFeaturedPost->have_posts()) : $otherFeaturedPost->the_post(); ?>
            <div id="slider2" class="spotlightwrapperbig"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
              <span class="teaser-image-small">
              <?php the_post_thumbnail'hotleft' ); ?>

  2. #2
    Scusatemi ma ho risolto...

    ho modificato

    Codice PHP:
    $otherFeaturedPost->query('showposts=5&cat='.get_option('top-news-category').'&offset=0'); 
    in

    Codice PHP:
    $otherFeaturedPost->query('showposts=5&orderby=rand'.'&offset=0'); 

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.