Risposte nei forum create
-
AutorePost
-
30 Dicembre 2009 alle 20:31 in risposta a: Aggiungere link “Leggi il seguito” alla fine dell’anteprima in HomePage #70375gollum1Partecipante
1) Copi bellemente il pezzo di codice che scrive il titolo del post, compreso di permalink, dopo the_except();
2) togli il pezzo di codice che scrive il titolo del post e lo sostituisci con la stringa “Continua a leggere”.
3) ottieni la scritta “Continua a leggere” che è un ulteriore permalink come il titolo.
byez
—
Gollum1
gollum1Partecipantebhe… left vuol dire a sinistra… giustamente…
controlla il css del tema per la classe dell’immagine incriminata…
Byez
—
Gollum1
gollum1Partecipanteevidentemente hai sbagliato il codice che legge la picture, e gli fai leggere sempre la stessa.
byez
—
Gollum1
30 Dicembre 2009 alle 16:03 in risposta a: Aggiungere link “Leggi il seguito” alla fine dell’anteprima in HomePage #70370gollum1PartecipanteAppunto, usando
< ?php the_excerpt(); ?>
viene visualizzato il riassunto, con […] al termine, ma senza link more (a meno che non inserisci esplicitamente il tag per il more nel testo). se inserisci il riassunto, e vuoi il link per continuare a leggerlo, inserisci nel codice un link che faccia riferimento ancora al permalink (come nel titolo). in pratica copi il codice che genera il titolo del post come link, invece di fargli mettere il titolo gli metti la frase “Continua a leggere…”
se non ho capito male questo è quello che vorresti ottenere, e quello che intedeva wolly con il rimando alla documentazione.
Byez
—
Gollum1`
29 Dicembre 2009 alle 16:27 in risposta a: Inserire articoli di una sola categoria in Home Page #70342gollum1Partecipantepuoi anche semplicemente far precedere il loop dalla funzione query_post(), dove indichi che vuoi visualizzare i post di una particolare categoria, senza uso di plugin.
Google:
codex.wordpress.org category post
Primo e secondo link:
ttp://codex.wordpress.org/The_Loop
http://codex.wordpress.org/The_Loop_in_Action
trovi info molto interessanti per il tuo problema,
se poi aggiungi query_post invece di post a google ottieni il seguente link:
http://codex.wordpress.org/Template_Tags/query_posts
Show One Category by Name
Display posts from only one category by name:
query_posts('category_name=Staff Home');
per essere più corretto dovresti mettere:
query_posts($query_string . 'category_name=Staff Home');
Byez
--
Gollum1
gollum1Partecipanteè sufficiente usare il parametro offset di querypost, spostandoti di tanti articoli quanto è il risultato del numero di pagine che stai visualizzando moltiplicato per il numero di post che stanno in ogni pagina.
il numero della pagina te lo prendi dell’url, il numero di articoli è una variabile di wp (che usi anche in query_post).
Byez
—
Gollum1
gollum1Partecipantegollum1Partecipantegollum1PartecipanteSan Google:
codex.wordpress.com exclude category
Primo link:
http://codex.wordpress.org/Template_Tags/wp_list_categories
exclude
(string) Exclude one or more categories from the results. This parameter takes a comma-separated list of categories by unique ID, in ascending order. See the example. The child_of parameter is automatically set to false.
exclude_tree
(string) Exclude category-tree from the results. This parameter added at Version 2.7.1
Byez
—
Gollum1
gollum1Partecipantein google:
codex.wordpress.com random post
primo link:
http://codex.wordpress.org/Template_Tags/get_posts
scorrendo la pagina:
Random posts
Display a list of 5 posts selected randomly by using the MySQL RAND() function for the orderby parameter value:
< ul>< li>< h2>A random selection of my writing< /h2>< ul>
< ?php
$rand_posts = get_posts('numberposts=5&orderby=rand');
foreach( $rand_posts as $post ) :
?>
< li>< a href="< ?php the_permalink(); ?>">< ?php the_title(); ?>< /a>< /li>
< ?php endforeach; ?>
< /ul>< /li>< /ul>
- attento agli spazi dopo ogni “<“
Byez
—
Gollum1
-
AutorePost