Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez
Last active May 29, 2018 09:00
Mostrar una plantilla según Post Format
<?php
if ( have_posts() ):
while ( have_posts() ): the_post();
//Cargamos una plantilla u otra en función del formato de post
//El primer parámetro que recibe es el nombre del directorio que contiene las plantillas
get_template_part('template-parts', get_post_format());
endwhile;
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment