Skip to content

Instantly share code, notes, and snippets.

@DavidPeralvarez
Last active May 29, 2018 09:00
Show Gist options
  • Save DavidPeralvarez/f32df2e92acb772dbca22f25c2c0ee0a to your computer and use it in GitHub Desktop.
Save DavidPeralvarez/f32df2e92acb772dbca22f25c2c0ee0a to your computer and use it in GitHub Desktop.
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