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 // colocar isso após o if(have_posts()):the_post(); | |
| $termsAutor = get_the_terms( get_the_ID(), 'NOMEDATAXONOMIA' ); | |
| $autor = ''; | |
| if ( $termsAutor && ! is_wp_error( $termsAutor ) ) { | |
| foreach ( $termsAutor as $term ) { | |
| if ( 0 == $term->parent ) { | |
| $autor = $term->name; | |
| } else {} | |
| } |
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 //CRIANDO SHORTCODE ?> | |
| <?php | |
| add_shortcode('NOMEDOSEUSHORTCODE', 'NOMEDAFUNCAO'); | |
| function NOMEDAFUNCAO() { ?> | |
| <?php ob_start(); ?> | |
| SEU CODIGO AQUI | |
| <?php return ob_get_clean(); ?> | |
| <?php } ?> | |
| <?php //INSERINDO SHORTCODE ?> |
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 | |
| global $post; | |
| $MeuQueryPostNovo = array( | |
| 'post_type' => 'NOMEDOPOSTTYPE', | |
| 'orderby' => 'date', | |
| 'order' => 'ASC', | |
| 'posts_per_page' => -1, | |
| ); | |
| $the_query = new WP_Query( $MeuQueryPostNovo ); | |
| ?> |
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
| /* | |
| javascript | |
| tem que incluir esse arquivo js: https://cdn.rawgit.com/giotiskl/Filterizr/1.3.4/dist/jquery.filterizr.min.js | |
| */ | |
| window.jQuery(function ($) { | |
| var $filterizd = $('.projects-gallery .items').filterizr({ | |
| filter: 'all', | |
| layout: 'sameSize', |
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(); ?> |
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 //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 | |
| //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 | |
| 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 ) { |