Last active
December 31, 2018 17:00
-
-
Save sophiawzey/b1310cb8aa57b268ecf87cff191aedb4 to your computer and use it in GitHub Desktop.
[Related Children] get the related children and exclude current post #wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// count for wpquery, goes here | |
$the_query = new WP_Query( $args ); | |
$count = $the_query->found_posts; | |
// then inside of the content | |
if ( $count > 2 ) { | |
echo '<div id="np-slider-three" class="np-slider">'; | |
} else { | |
echo '<div class="grid-x grid-margin-x medium-up-3">'; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment