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
| ## Comandos básicos ## | |
| git status (ver o status do git) | |
| git add . (para subir todos) | |
| git add nomedoaquivo.extrensao (subir arquivo especifico) | |
| git add * .extensao (subir arquivos dessa extensao) | |
| git add -u (deletar oq ta no status como delete) | |
| git commit -m "O COMENTARIO" (descrever oq vc ta subindo) | |
| git commit -a -m "O COMENTARIO" (ele pula a etapa do git add) | |
| git diff (ele mostra oq foi alterado nos arquivos modificados, antes de ter dado um git add) | |
| git diff --staged (ele mostra oq foi alterado nos arquivos modificados, depois de ter dado um git add, mas antes de dar um git commit) |
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
| # Estrutura de URL para WooCommerce | |
| https://wordpress.org/plugins/woo-permalink-manager/ |
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 | |
| /* | |
| Supondo que voce tenha um link de paginação parecida com http://seusite.com.br/blog/page/2 | |
| O rel = "canonical" é exibido como http://seusite.com.br/blog/page/2 | |
| Esse filtro serve para deixar o seu canical como: http://seusite.com.br/blog | |
| Evitando assim que o google considere páginas duplicadas | |
| */ | |
| //URL CANONICAL (coloque isso no seu function) | |
| function return_canon () { |
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
| //RETIRAR O /CATEGORY DA URL | |
| add_filter('user_trailingslashit', 'remcat_function'); | |
| function remcat_function($link) { | |
| return str_replace("/category/", "/", $link); | |
| } |
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 | |
| 1. Create your custom post type (unless already created). This can be done very easily by using the great, free Custom Post Type UI plugin. | |
| 2. Create a plugin for our new code to live in (yes, it could go in your theme’s functions.php file, but then it’d be lost if the theme were changed!). | |
| ?> | |
| <?php | |
| // PARTE 1 DO FUNCTIONS: | |
| // 3. Filter the permalink for our custom post type so that all published posts don’t have the slug in their URLs: | |
| //Remova o slug dos permalinks de postagem publicados. Apenas afeta nosso tipo de postagem personalizada. | |
| function gp_remove_cpt_slug( $post_link, $post ) { |
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 | |
| //Para resolver isso, estou disponibilizando um pequeno snippet que, se nenhum informação de peso for passada ao plugin WooCommerce Correios, então o peso será 300 gramas. Se algum peso for informado, então este será utilizado normalmente. | |
| add_filter( 'woocommerce_correios_shipping_args', 'fa_min_correios_weight' ); | |
| function fa_min_correios_weight( $args ) { | |
| $args['nVlPeso'] = ! $args['nVlPeso'] ? 0.3 : $args['nVlPeso']; | |
| return $args; | |
| } | |
| ?> |
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 //COLE ISSO EM LOOP DO POST TYPE ?> | |
| <?php $getCats = get_terms("NOMEDATAXONOMIA", array("hide_empty" => false)); ?> | |
| <?php foreach($getCats as $getCat): ?> | |
| <?php // USE ESSE TRECHO APENAS SE A SUA TAXONOMIA CONTER CAMPO PARSONALIZADO | |
| $id_Imagem = get_term_meta($getCat->term_id, 'NOMEDOCAMPOPERSONALIZADO', true); | |
| $minhaImagem = wp_get_attachment_image_src($id_Imagem,'full'); | |
| ?> | |
| <div class="item"> | |
| <a href="<?php echo get_term_link($getCat->term_id); ?>"> | |
| <figure> |
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 | |
| /** | |
| * [IMPORTANTE] COMO USAR | |
| * | |
| * Adicione o shortcode [instagram_photos] dentro do conteúdo de uma página | |
| * ou use o código php do_shortcode('[instagram_photos]') | |
| * | |
| * | |
| * Você pode usar o atributo "limit" para limitar o máximo de fotos que serão mostrados. |
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 query_posts(array('post_type' => 'NOMEDOSEUCUSTOMPOSTTYPE')); ?> | |
| <h1><?php post_type_archive_title(); ?></h1> | |
| <?php wp_reset_query(); ?> |