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
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 |
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 | |
$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']), | |
) | |
); |
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 | |
$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'], | |
) |
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
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); |
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
function codeAddress(address) { | |
geocoder = new google.maps.Geocoder(); | |
geocoder.geocode({ | |
'address': address | |
}, function(results, status) { | |
if (status == google.maps.GeocoderStatus.OK) { | |
var myOptions = { | |
zoom: 14, | |
center: results[0].geometry.location, | |
disableDoubleClickZoom: true, //not zoom |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundAlphaInactive</key> | |
<real>0.73665552745664742</real> | |
<key>BackgroundBlur</key> | |
<real>0.091763005780346824</real> | |
<key>BackgroundColor</key> | |
<data> |
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 | |
$datetime = '01/06/1985 15:45'; | |
$timestamp = DateTime::createFromFormat('d/m/Y H:i', $datetime)->getTimestamp(); | |
echo $timestamp; | |
$datetime = date('d-m-Y H:i', $timestamp); | |
var_dump($datetime); |
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
## /private/etc/hosts | |
# | |
# Host Database | |
# | |
# localhost is used to configure the loopback interface | |
# when the system is booting. Do not change this entry. | |
## | |
127.0.0.1 localhost | |
255.255.255.255 broadcasthost | |
::1 localhost |
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
$( "#sortable" ).sortable({ | |
forcePlaceholderSize: true, | |
tolerance: 'pointer', | |
cursor: 'pointer', | |
over: function () { | |
removeIntent = false; | |
}, | |
out: function () { | |
removeIntent = true; | |
}, |
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
functions.php | |
<?php | |
function my_custom_queries($query) { | |
//Never in admin mode, only the main query(the URL one) and in this case on custom post 'event' | |
if ( !is_admin() && $query->is_main_query() && $query->is_post_type_archive('event')) { | |
$paged = ( get_query_var( 'page' ) ) ? absint( get_query_var( 'page' ) ) : 1; //URL /page | |
OlderNewer