This file contains hidden or 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 | |
$sticky = get_option( 'sticky_posts' ); | |
/* Sort the newest one at the top */ | |
rsort( $sticky ); | |
/* Get the 2 newest stickies (change 2 for a different number) */ | |
$sticky = array_slice( $sticky, 0, 2 ); | |
/* Query Post */ |
This file contains hidden or 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 | |
/** | |
* Get the terms of post | |
* @param object $p The post | |
* @param string $class CSS Class | |
* @param string $separator | |
* @return string The terms | |
*/ | |
function get_post_terms($p, $class = 'post-preview__cat', $separator = '') { |