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
<? | |
$yourTaxonomySlugHere = get_the_terms($post->ID, 'yourTaxonomySlugHere'); | |
if ($terms) : | |
foreach ($terms as $term) : | |
echo $term->name; | |
endforeach; | |
endif; | |
?> |
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
(function() { | |
/* Define a variável que dá swipe no lightbox */ | |
var magnificPopup = $.magnificPopup.instance; | |
/* Carrega a função quando clica no lightbox (senão não pega a classe utilizada) */ | |
$("a.image-lightbox").click(function(e) { | |
/* Espera carregar o lightbox */ | |
setTimeout(function() { | |
/* Swipe para a esquerda - Próximo */ |
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
$(document).find('body').append('<div id="div-width-top" style="position: fixed; right: 5px; top: 5px; background: #000; color: #fff; padding: 10px; z-index: 99999; opacity: 0.7">Window Size:</div>'); | |
$('#div-width-top').html('ViewPort: ' + window.innerWidth + 'px | Window: ' + screen.width + 'px'); | |
$(window).resize(function() { | |
$('#div-width-top').html('ViewPort: ' + window.innerWidth + 'px | Window: ' + screen.width + 'px'); | |
}); |
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
// Create a new viewpoint bound | |
var bounds = new google.maps.LatLngBounds(); | |
// Go through each... | |
for (var i = 0, LtLgLen = _latlng.length; i < LtLgLen; i++) { | |
// And increase the bounds to take this point | |
bounds.extend (_latlng[i]); | |
} | |
// Fit these bounds to the map | |
map.fitBounds(bounds); |
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
add_action( 'init', 'handle_preflight' ); | |
function handle_preflight() { | |
header("Access-Control-Allow-Origin: " . get_http_origin()); | |
header("Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE"); | |
header("Access-Control-Allow-Credentials: true"); | |
if ( 'OPTIONS' == $_SERVER['REQUEST_METHOD'] ) { | |
status_header(200); | |
exit(); |
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 | |
public function try_debugger($url) | |
{ | |
$url = "https://graph.facebook.com/?id=". urlencode($url) ."&scrape=true&method=true"; | |
$ch = curl_init(); | |
curl_setopt($ch,CURLOPT_URL,$url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); | |
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5); |
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 FEATURED IMAGE | |
function ST4_get_featured_image($post_ID) { | |
$post_thumbnail_id = get_post_thumbnail_id($post_ID); | |
if ($post_thumbnail_id) { | |
$post_thumbnail_img = wp_get_attachment_image_src($post_thumbnail_id, 'featured_preview'); | |
return $post_thumbnail_img[0]; | |
} | |
} |
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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
OlderNewer