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
| function feed_cidades($categoria) { | |
| if ($categoria == '') { | |
| $args = array ( | |
| 'post_type' => 'cidades', //it can be other | |
| 'posts_per_page' => '-1' | |
| //'post__not_in' => array($exclude) | |
| ); | |
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
| /* -------------------------------- | |
| Insere estilos no painel de administração | |
| Alan | |
| ------------------------------------ */ | |
| add_action('admin_head', 'custom_admin_styles'); |
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
| /* ---------------- | |
| Altera o HTML de saída das galerias | |
| Alan | |
| ----------------- */ | |
| add_filter('post_gallery', 'my_post_gallery', 10, 2); |
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
| if( has_term( 'jazz', 'genre' ) ) { | |
| // do something | |
| } | |
| // ou | |
| has_term( $term, $taxonomy, $post ); | |
| //https://codex.wordpress.org/Function_Reference/has_term |
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
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=utf-8"/> | |
| <script type="text/javascript" src="jquery-1.7.1.min.js"></script> | |
| <script type="text/javascript"> | |
| $(document).ready(function () { | |
| $.getJSON('estados_cidades.json', function (data) { |
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 | |
| if ( isset( $_POST['submitted'] ) && isset( $_POST['post_nonce_field'] ) && wp_verify_nonce( $_POST['post_nonce_field'], 'post_nonce' ) ) { | |
| $postTitleError = ''; | |
| if ( isset( $_POST['submitted'] ) ) { | |
| if ( trim( $_POST['postTitle'] ) === '' ) { |
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 de blog com paginação e com primeiro post diferenciado | |
| Usado em Gamarra | |
| Alan | |
| */ | |
| // WP_Query arguments | |
| $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; | |
| $args = array( | |
| 'post_type' => '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 the_time('j \d\e F \d\e Y') ?> |
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
| // se for um post | |
| echo get_the_post_thumbnail( $post_id, 'thumbnail', array( 'class' => 'alignleft' ) ); | |
| //Se for uma página | |
| echo get_the_post_thumbnail( $page->ID, 'full', array( 'class' => 'img-responsive' ) ); |
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
| /* | |
| CHECA SE A PAGINA É FILHA | |
| */ | |
| function is_child() { | |
| global $post; // if outside the loop | |
| if ( is_page() && $post->post_parent ) { | |
| return true; // This is a subpage |