Skip to content

Instantly share code, notes, and snippets.

View rodrigo-brito's full-sized avatar
🇧🇷
You are what you share

Rodrigo Brito rodrigo-brito

🇧🇷
You are what you share
View GitHub Profile
@rodrigo-brito
rodrigo-brito / gist:2a23b6712aea9a984213
Last active August 29, 2015 14:20
Related post - Custom taxonomy and Custom post type
<div class="related-posts">
<?php
$terms = get_the_terms( $post->ID , 'genero'); //genero é a taxonomia que criei aqui
if ( $terms && ! is_wp_error( $terms ) ) {
$slugs = array();
foreach ( $terms as $term ) {
$slugs[] = $term->term_id;
}
}