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 | |
//Inserir Informacoes no Header - Isso você coloca no functions.php ;) | |
add_action( 'wp_head', 'InformacoesDoHeader', 1 ); | |
function InformacoesDoHeader () { ?> | |
Aqui você coloca as informações que precisa adicionar header do seu site. Meta, Css.... | |
<?php } ?> |
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 | |
// Let’s instantiate this class in our functions.php file: | |
if( is_admin() ) { | |
require 'simple_settings_page.php'; | |
new simple_settings_page(); | |
} |
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
Metódo antigo Quaery_post | |
<?php query_posts(array('post_type' => 'representantes', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 2)); ?> | |
<section> | |
<?php while(have_posts()):the_post(); ?> | |
<?php $imagem = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); ?> | |
<div class="item-<?=$post->post_name;?>"> | |
<figure style="background-image: url('<?php echo $imagem[0] ?>');"></figure> | |
<h4><?php the_title(); ?></h4> | |
<?php the_content(); ?> |
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 //COMO INSERIR UM REPETIDOR DENTRO DE OUTRO REPETIDOR ACF ?> | |
<section id="case-resultados"> | |
<div class="grid-container"> | |
<?php if(get_field('itens_cases_resultado')): ?> | |
<div id="cases-results"> | |
<?php foreach(get_field('itens_cases_resultado') as $key => $value): ?> | |
<div class="item"> | |
<figure> | |
<img src="<?php echo $value['logo_cases_resultado']; ?>"> | |
</figure> |
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//IDENTIFICA SE JA COMPROU O PRODUTO E MUDA O BOTAO (COLOCA ISSO NO SEU FUNCTION) | |
function has_bought_items($meuCursoID) { | |
$bought = false; | |
// Set HERE ine the array your specific target product IDs | |
$prod_arr = array( $meuCursoID ); | |
// Get all customer orders | |
$customer_orders = get_posts( array( | |
'numberposts' => -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
<?php | |
//ESSE CODIGO VERIFICA O VALOR DO SELECT ACF E VERIFICA SE O ARQUIVO EXISTE | |
$selectTheme = get_field('escolha_o_tema'); | |
if(file_exists(get_stylesheet_directory().'/template-parts/'.$selectTheme.'.php')) | |
load_template(get_stylesheet_directory().'/template-parts/'.$selectTheme.'.php'); | |
?> |
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 PRECISO QUE TENHA:FOTO/NUMERO DE CURTIDA / NUMERO DE COMENTARIO / DESCRICAO ?> | |
<?php | |
//SHORTCODE INSTAGRAM | |
add_filter( 'wpis_default_shortcode_attributes', 'custom_wpis_instagram_access_token' ); | |
function custom_wpis_instagram_access_token ( $atts ) { | |
$atts['token'] = '2195092261.1677ed0.f7e6b044cdc54b859d0f9413e0e404c6'; | |
return $atts; | |
} |
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 //INSIRA ACIMA DA CHAMADA GET_HEADER ?> | |
<?php acf_form_head(); ?> | |
<?php //MOSTRAR OS CAMPO NO FRONT ?> | |
<?php acf_form(array( | |
'post_id' => 'new_post', | |
'field_groups' => array(3484), // ID DO SEU CAMPO PERSONALIZADO | |
'form' => true, | |
'new_post' => array( | |
'post_type' => 'depoimentos', //SLUG DO CUSTOM POST TYPES |
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 //Utilizando ACF Multi Dates Field - Uma extensão do ACF para selecionar multiplas datas ?> | |
<?php | |
setlocale (LC_ALL, 'pt_BR'); | |
$dataArray = get_field('data_curso'); | |
$data = end($dataArray); | |
$periodoCurso = array_map(function($value) use($data){ | |
if($data == $value) | |
return strftime('%d de %B de %Y',strtotime($value)); | |
return strftime('%d',strtotime($value)); |
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 // 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 {} | |
} |
OlderNewer