Skip to content

Instantly share code, notes, and snippets.

@juanmafla
Created October 27, 2018 17:19
Show Gist options
  • Select an option

  • Save juanmafla/b187da9c468e1855706cf7c2f673e7da to your computer and use it in GitHub Desktop.

Select an option

Save juanmafla/b187da9c468e1855706cf7c2f673e7da to your computer and use it in GitHub Desktop.
<?php
$args = array(
'post_type' => 'comentarios_facebook',
'post_status' => 'publish',
);
$comentarios = new WP_Query( $args );
if( $comentarios->have_posts() ) :
?>
<ul>
<?php
while( $comentarios->have_posts() ) :
$comentarios->the_post();
?>
<li><?php printf( '%1$s - %2$s', get_the_title(), get_the_content() ); ?></li>
<?php
endwhile;
wp_reset_postdata();
?>
</ul>
<?php
else :
esc_html_e( 'No hay comentarios!', 'text-domain' );
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment