Skip to content

Instantly share code, notes, and snippets.

SET @oldsite='http://localhost.com';
SET @newsite='http://producao.com.br';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
UPDATE wp_posts SET guid = replace(guid, @oldsite, @newsite);
@everaldomatias
everaldomatias / get_excerpt()
Last active August 29, 2015 14:20
Função WordPress para gerar resumos com limite de caracteres
/**
* Function get_excerpt
*
* @since 0.1
*
* @param string $content with text to excerpt.
* @param string $limit number of the limit.
* @param string $after with element to print in end excerpt.
*
* @return string
<?php
// Versão funcionando, pelo menos para minha necessidade
// Essa função é disparada com alguns critérios em uma página usada apenas para essa migração.
function migration() {
include( 'wp-admin/includes/media.php' );
include( 'wp-admin/includes/file.php' );
include( 'wp-admin/includes/image.php' );
$query = new WP_Query( array(
'post_type' => 'post', /* O post type que vai usar*/
'posts_per_page' => -1,
(function($){
$('.menu-clientes').on('click', function () {
$('html, body').animate({
scrollTop: $("#clientes").offset().top-40
}, 2000);
});
})(jQuery);