Last active
May 6, 2018 16:20
-
-
Save anatol06/82ba046e26434080e28479463e8e6a37 to your computer and use it in GitHub Desktop.
Get a featured query with each even post floated Right
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
<?php | |
$i = 0; // Counter | |
?> | |
<?php $featured_query = new WP_query(array( | |
'category_name' => 'featured' )); ?> | |
<?php while ($featured_query->have_posts()) : | |
$featured_query->the_post(); ?> | |
<?php | |
$i++; | |
if ($i % 2 != 0) { | |
$float = 'no-float'; | |
} else { | |
$float = 'float-right'; | |
} | |
?> | |
<!-- HTML Code Here--> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment