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($){ | |
$('.menu-clientes').on('click', function () { | |
$('html, body').animate({ | |
scrollTop: $("#clientes").offset().top-40 | |
}, 2000); | |
}); | |
})(jQuery); |
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 | |
// 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, |
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 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 |
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
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); |
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 | |
$args = array( 'hide_empty=0' ); | |
$funcoes = get_terms( 'posicao', $args ); | |
if ( ! empty( $funcoes ) && ! is_wp_error( $funcoes ) ) { | |
$count = count( $funcoes ); | |
foreach ( $funcoes as $funcao ) { | |
$output_terms .= $funcao->term_id . ','; | |
} | |
} |
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
// WordPress | |
// Use in functions.php | |
// Disable the admin bar except for admin users | |
add_action( 'after_setup_theme', 'remove_admin_bar' ); | |
function remove_admin_bar() { | |
if ( ! current_user_can( 'administrator' ) && ! is_admin() ) { | |
show_admin_bar( false ); | |
} | |
} |
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
<div class="w80">[email* your-email placeholder "Seu melhor e-mail"]</div> | |
<div class="w20">[submit "Enviar"]</div> |
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
input[type="email"], input[type="submit"] { | |
width: 100%; | |
} | |
.w20 { | |
float: left; | |
width: 20%; | |
} | |
.w40 { | |
float: left; | |
width: 40%; |
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 change_labels_post( $labels ) { | |
//$labels->name = 'Posts'; | |
//$labels->singular_name = 'Post'; | |
//$labels->add_new = 'Adicionar Novo'; | |
//$labels->add_new_item = 'Adicionar novo post'; | |
//$labels->edit_item = 'Editar post'; | |
//$labels->new_item = 'Novo Post'; | |
//$labels->view_item = 'Ver Post'; | |
//$labels->search_items = 'Pesquisar posts'; |
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 | |
require_once get_template_directory() . '/core/classes/class-metabox.php'; | |
// Adiciona galeria de fotos com odin metabox | |
function gallery_metabox() { | |
$videos_metabox = new Odin_Metabox( | |
'fotos', // Slug/ID of the Metabox (Required) | |
'Galeria de Fotos', // Metabox name (Required) |
OlderNewer