Home › Forum › Problemi Vari con WP › estraggo solo sei articoli ..dove sbaglio?
-
AutorePost
-
-
21 Settembre 2011 alle 2:11 #19200catarsiPartecipante
salve ragazzi,
sto lavorando ad un mio tema in cui estraggo gli articoli e li faccio girare tramite un jquery carousel.
uso questo codice:
<?php
$args = array ( 'numberposts' => 999, 'order'=> 'ASC', 'orderby' => 'title' );
$postslist = get_posts( $args.'&category=4' ); /* qui ho aggiunto .'&category=3'*/
foreach ($postslist as $post) : setup_postdata($post); ?>
<div class="content-img">
<?php
preg_match_all("/(]*>)/",get_the_content(),$matches,PREG_PATTERN_ORDER);
for( $i=0; isset($matches[1]) && $i < count($matches[1]); $i++ ) {
echo $beforeEachImage . $matches[1][$i] . $afterEachImage;}?>
</div>
il number post l’ho configurato a 999 ma cmnq sia mi estrae solo 6 articoli…
a questo punto sono andato sulle impostazioni di wordpress ..su lettura per l’esattezza
inpostando “le pagine del blog visualizzano al massimo 50 articoli più recenti”
ma niente da fare…
qualcuno di voi ha idea di dove posso andare a modificare questo dettaglio che mi mostra solo sei post?
-
21 Settembre 2011 alle 5:40 #88302SteveAglAmministratore del forum
non funzionerà il richiamo di due categorie direi che ti mostra solo quelli della categoria 3 che guardacaso sono solo sei.. o sbaglio?
-
22 Settembre 2011 alle 13:56 #88352catarsiPartecipante
oh no scusami il commento era per me il codice va inteso solo come :
$args = array ( ‘numberposts’ => 999, ‘order’=> ‘ASC’, ‘orderby’ => ‘title’ );
$postslist = get_posts( $args.’&category=4′ );
foreach ($postslist as $post) : setup_postdata($post); ?>
funziona e gli articoli di cat 4 sono + di dieci
ma semrpe sei me ne mostra
-
22 Settembre 2011 alle 15:58 #88353catarsiPartecipante
bene, ho risolto da solo .. scrivo qui per i “posteri”…
l’errore era nell’ array di defoult che viene caricato da post.php che limita a 5 posto automaticamente… poi perché me lo beccava qui visto che ridefinisco ‘numberposts’ non lo so …
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.