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
// Add to existing function.php file | |
// Disable support for comments and trackbacks in post types | |
function df_disable_comments_post_types_support() { | |
$post_types = get_post_types(); | |
foreach ($post_types as $post_type) { | |
if(post_type_supports($post_type, 'comments')) { | |
remove_post_type_support($post_type, 'comments'); | |
remove_post_type_support($post_type, 'trackbacks'); | |
} | |
} |
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
echo get_the_post_thumbnail_url(get_the_ID(),'medium'); // thumbnail, full | |
ou | |
echo wp_get_attachment_url( get_post_thumbnail_id( $saved_post_id ) ); | |
ou | |
echo '<img src="'.get_the_post_thumbnail( $post_id, 'medium' ).'">'; |
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 lista_paginas($atts) { | |
ob_start(); | |
$a = shortcode_atts( array( | |
'categoria' => '', | |
), $atts ); | |
echo'<div class="">'; | |
global $post; | |
$args = array( | |
'post_type' => '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
Host do SMTP: localhost | |
Porta SMTP: 587 | |
Criptografia: TLS | |
Autenticação: true | |
SMTP Username: [email protected] | |
SMTP Password: senha do email |
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 fontawesome() { | |
wp_enqueue_style( 'fontawesome', 'https://use.fontawesome.com/releases/v5.0.13/css/all.css', array(), '1.0', 'all'); | |
} | |
add_action( 'wp_enqueue_scripts', 'fontawesome' ); |
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
// caminho do diretório do tema | |
<img src="<?php echo get_stylesheet_directory_uri() ?>/images/.jpg" /> | |
<img src="<?php bloginfo('template_directory'); ?>/images/.jpg" /> | |
// pegar url imagem destacada | |
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' ); | |
$thumb[0] | |
// archive custom post type e taxonomy | |
if (is_tax( 'categoria-embarcacao' )): |
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
add_filter( 'pre_get_posts', 'tgm_io_cpt_search' ); | |
/** | |
* This function modifies the main WordPress query to include an array of | |
* post types instead of the default 'post' post type. | |
* | |
* @param object $query The original query. | |
* @return object $query The amended query. | |
*/ | |
function tgm_io_cpt_search( $query ) { | |
if ( $query->is_search ) { |
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
var deadline = "Sep 24, 2018 00:00 GMT-3"; |
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
$url = parse_url($_SERVER['REQUEST_URI']); | |
if(isset($url['query'])) : | |
//code | |
endif; |
OlderNewer