Created
July 12, 2017 19:51
-
-
Save SauntValerian/f2a50206575072475911ba6d90f0412b to your computer and use it in GitHub Desktop.
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
// Don't use multiple loops here. Loop through all your posts once, and store each post into an array depending on which tier it falls into. E.g. | |
$tiers = array( | |
'platinum' => array(), | |
'gold' => array(), | |
'silver' => array(), | |
'bronze' => array() | |
); | |
//Afterwards, the array should be populated with posts. Loop through the array and handle it accordingly. | |
foreach ( $tiers as $level => $posts ) { | |
foreach ( $posts as $post ) { | |
// output each post | |
// do some fancy output using $level if needed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment