Home › Forum › Problemi Vari con WP › Devo far visualizzare un articolo ben preciso, come faccio?
-
AutorePost
-
-
29 Aprile 2009 alle 9:10 #10244cicciocardulloPartecipante
Salve a tutti, ho un piccolo problema, normalmente si utilizza questo codice:
<?php wp_get_archives('type=postbypost&limit=1'); ?>
cosଠfacendo mi fa visualizzare solo l'ultimo articoli inserito, ma se io avessi la necessità di visualizzare solo il terzultimo articolo? come faccio?
Grazie per la riposta!
-
29 Aprile 2009 alle 9:48 #64939wollyAmministratore del forum
puoi utilizzare query_posts http://codex.wordpress.org/Template_Tags/query_posts
-
29 Aprile 2009 alle 9:50 #64940wollyAmministratore del forum
oppure se è cosa più complessa http://codex.wordpress.org/Function_Reference/WP_Query
-
29 Aprile 2009 alle 11:50 #64946cicciocardulloPartecipante
puoi utilizzare query_posts http://codex.wordpress.org/Template_Tags/query_posts
Wolly, grazie per la risposta, ho provato per più di 2 ore.. ma proprio non ci riesco… mi daresti una mano?
Grazieee!! ciao!
-
29 Aprile 2009 alle 12:10 #64947wollyAmministratore del forum
comincia a spiegare precisamente quello che vuoi fare,fai finta che noi non si sia nella tua testa e quindi devi farci capire quello che vuoi fare, perchè dire terz’ultimo non vuole dire nulla.
-
29 Aprile 2009 alle 12:42 #64948cicciocardulloPartecipante
comincia a spiegare precisamente quello che vuoi fare,fai finta che noi non si sia nella tua testa e quindi devi farci capire quello che vuoi fare, perchè dire terz’ultimo non vuole dire nulla.
Ciao.. inizio a spiegare.. cosଠmagari mi viene la soluzione
Sto modificando una parte del mio blog, esattamente l’elenco che riguarda gli articoli recenti.
Ho la semplice necessità di inserire gli ultimi 5 articoli inseriti, ma oltre a questo elenco devo anche inserire una spede di nuvoletta dove andando sopra il link compare e sono inserire alcune informazioni dell’articolo (come categoria, numero commenti ecc..)
Ma, siccome se inserisco il codice: <?php wp_get_archives(‘type=postbypost&limit=5’); ?> non mi ripete per tutti i link le nuvelette, ma solo una volta, quindi ho la necessità di scrivere 5 volte lo script che riguarda l’inserimento del titolo dell’articolo e la nuvoletta.
Inserendola 5 volte, devo necessariamente impostare che la prima volta, mi deve leggere l’ultimo articolo inserito, con il secondo script, voglio che mi inserisca il penultimo articolo… con il terzo script voglio che mi inserisca il terzultimo e cosଠvia..
Ma, non riesco a fare un codice del genere, sono riuscito a leggere per ID ma a me non serve, voglio che mi legga gli ultimi 5, ma devo impostare io quale dei 5!
Se ancora non hai capito ti invio il link del blog, grazie ancora, ciao!
-
29 Aprile 2009 alle 13:26 #64949wollyAmministratore del forum
http://www.wpitaly.it/wiki/Main/FaqGenerali#toc9
con questo sistema puoi contare gli articoli e decidere cosa fare per ogni articolo.
Poi stasera ci penso con calma.
ciao
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.