Visualizzazione 2 filoni di risposte
Visualizzazione 2 filoni di risposte
- Devi essere connesso per rispondere a questo topic.
Email: info@wpitaly.it
Home › Forum › Plugin e temi di WP › Unico Post Random “Aperto” in Home
Gentilissimi,ho provato diversi plugin e fatto numerose ricerche ma senza successo, questo il mio problema :
voglio avere un unico post casuale in home page preso ovviamente dall’ archivio
Il post deve essere “aperto” nel senso che non deve fermarsi al tag <—more—>.
Meglio se il post cambia ma solo 1 volta al giorno
avete idee in merito ?
grazie in anticipo e buone feste a tutti
Pensavo impostare una pagina statica in Home page,
nella pagina inserire il codice php che richiamasse post in modo casuale.
Si può fare ?
qulcuno ha qualche snippet di codice che fa al caso ?
grazie e buone feste
in 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>
Byez
—
Gollum1
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0