Skip to content

Instantly share code, notes, and snippets.

View leocaseiro's full-sized avatar
💭
I',m probably studying...

Leo Caseiro leocaseiro

💭
I',m probably studying...
View GitHub Profile
function get_tweets($tweet_count, $username) {
if (empty($username))
return false;
$list = get_transient('list_of_tweets');
if (!$list) {
return fetch_tweets($tweet_count, $username);
<?php
$params = array('post_type' => 'garimpeiros', 'paged' => $paged);
if (isset($wp_query->query_vars['estado']) && '' != $wp_query->query_vars['estado'] ) :
$params['meta_query'] = array(
array(
'key' => 'estado',
'compare' => '=',
'value' => $wp_query->query_vars['estado'],
)
<?php
$params = array('post_type' => 'garimpeiros', 'paged' => $paged);
if (isset($wp_query->query_vars['estado']) && '' != $wp_query->query_vars['estado'] ) :
$params['tax_query'] = array(
array(
'taxonomy' => 'estado',
'field' => 'slug',
'terms' => array($wp_query->query_vars['estado']),
)
);
functions.php
<?php
function custom_rewrite_rules() {
global $wp_rewrite;
// Define the param estado
add_rewrite_tag( '%estado%', '([^&]+)' );
//For this result: empresas-garimpeiras/estado/pernambuco