Skip to content

Instantly share code, notes, and snippets.

View celsofabri's full-sized avatar
👾
The truth is dubious

Celso Fabri Junior celsofabri

👾
The truth is dubious
View GitHub Profile
@celsofabri
celsofabri / functions.php
Created July 26, 2016 02:54 — forked from cezarsmpio/functions.php
Wordpress - Get the post terms
<?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 = '') {
@celsofabri
celsofabri / limit-sticky-posts.php
Last active August 29, 2015 14:07 — forked from fernandofuly/limit-sticky-posts.php
Limit Number of Sticky Posts to Show / Limitando Número de Posts Fixos Exibidos
<?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 */