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 | |
$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 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 specific post in a list | |
* @param object $p The post | |
* @param array $params An array of params | |
* @return string The HTML result | |
*/ | |
function get_post_terms($p, $params = array()) { | |
$defaults = array( |
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
HTMLElement.prototype.css = function (style) { | |
for (let k in style) { | |
this.style[k] = style[k]; | |
} | |
}; | |
// Example 1 | |
document.body.css({ | |
backgroundColor: 'rgb(20,20,20)', | |
fontFamily: 'Arial, sans-serif', |