
Asumiendo que ya has creado una página template personalizada y/o tienes el loop listo, pega el siguiente código antes de el loop:
<?php
/* Get all sticky posts */
$sticky = get_option( ‘sticky_posts’ );/* Sort the stickies with the newest ones at the top */
rsort( $sticky );/* Get the 5 newest stickies (change 5 for a different number) */
$sticky = array_slice( $sticky, 0, 5 );/* Query sticky posts */
query_posts( array( ‘post__in’ => $sticky, ‘caller_get_posts’ => 1 ) );
?>
Este código puede ser utilizado en slider o cualquier otra propiedad avanzada que desees implementar en tu sitio. El snippet está sobre todo orientado hacia un sitio de WordPress que tiene una página principal personalizada o un look estilo revista.
Visto en: wpbeginner












Deja un comentario