Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Forked from rallemann/facetwp conditionals in loop
Created June 22, 2016 10:21
Show Gist options
  • Save mgibbs189/8ef00bb4342c6dc60791b9e43941481f to your computer and use it in GitHub Desktop.
Save mgibbs189/8ef00bb4342c6dc60791b9e43941481f to your computer and use it in GitHub Desktop.
<?php
return array(
"post_type" => array(
"cpt1",
"cpt2"
),
'posts_per_page' => 28,
'orderby' => 'rand',
);
?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( 'cpt1' == $post->post_type ) : ?>
Hello World
<?php endif; ?>
<?php if ( 'cpt2' == $post->post_type ) : ?>
Goodbye World
<?php endif; ?>
<?php endwhile; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment