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 | |
/* | |
Enviar e-mail para o administrador se houver posts para revisão | |
Dica do @GugaAlves: incluir link para a edição do post no admin, facilitando a vida do admin que receber este email. | |
Dica do Gustavo Bordoni (@webord): incluir na função o $post (objeto para WP_Query) para não ficar passando o $post_id a cada save. | |
Dica do Manoel Netto: Incluir a verificação "! wp_is_post_revision( $post )" para não enviar e-mail a cada auto save. | |
*/ |
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
<div class="row"> | |
<div class="col-md-12 text-default"> | |
<div class="newsletter widget_wysija_cont html_wysija"> | |
<!-- Conferir o ID do form nas configurações do formulário, versão HTML --> | |
<div id="msg-form-wysija-html53c535dfee43f-1" class="wysija-msg ajax"></div> | |
<form id="form-wysija-html53c535dfee43f-1" method="post" action="#wysija" class="form-inline widget_wysija html_wysija"> | |
<div class="col-md-3 col-sm-12 col-xs-12 form-group texto"> | |
<i class="fa fa-envelope-o"></i> Assine nossa Newsletter | |
</div> | |
<div class="col-md-3 col-sm-6 col-xs-12 form-group wysija-paragraph"> |
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
add_action('admin_bar_menu', 'show_template'); | |
function show_template() { | |
global $template; | |
print_r($template); | |
} |
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 | |
// Adicione esta função no functions.php | |
add_filter( 'contextual_help', 'mytheme_remove_help_tabs', 999, 3 ); | |
function mytheme_remove_help_tabs($old_help, $screen_id, $screen){ | |
$screen->remove_help_tabs(); | |
return $old_help; | |
} | |
?> |
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
//Redirecionar o usuário após o login | |
function redirect_user_login() { | |
if (!current_user_can('manage_woocommerce')) { | |
$url = home_url(); //redirecionar pra home | |
return $url | |
} | |
} | |
add_filter( 'login_redirect', 'redirect_user_login', 10, 3 ); |
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 ( have_posts() ) : | |
while ( have_posts() ) : the_post(); | |
// the loop | |
$checkpost = get_post_status ( post->ID ); | |
$author_id = the_author_meta('ID', post->ID); | |
$user_id = get_current_user_id(); | |
$private = get_post_custom_values('private'); // read custom field | |
if ( $checkpost == 'private' && $user_id == $author_id ) { | |
// display private post, only logged user who had posted this post | |
} 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
/* | |
* | |
* This CSS template will customize WordPress.org login pages: | |
* | |
* Login page: /wp-login.php | |
* Register page: /wp-login.php?action=register | |
* Lost Password page: /wp-login.php?action=lostpassword | |
* | |
* @site https://tudoparawp.com.br | |
* @author Guga Alves |
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
// Add Shortcode | |
function button_category($post_id) { | |
$category = get_the_category( $post_id ); | |
$return = '<a href="'. esc_url( get_category_link( $category[0]->term_id ) ) .'">Ver ' . $category[0]->cat_name . '</a>'; | |
return $return; | |
} | |
add_shortcode( 'button-category', 'button_category' ); |
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 | |
/** | |
* Please see single-event.php in this directory for detailed instructions on how to use and modify these templates. | |
* | |
* Override this template in your own theme by creating a file at: | |
* | |
* [your-theme]/tribe-events/month/tooltip.php | |
* @version 4.6.21 | |
*/ | |
?> |
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 | |
/** | |
* | |
* Custom function setting events as Featured Event when meeting your custom criteria | |
* | |
* @link https://theeventscalendar.com/knowledgebase/k/using-tribe_get_events/ | |
* | |
* Note that you can use all arguments available on WP_Query class => http://codex.wordpress.org/Class_Reference/WP_Query | |
* The Events Calendar exposes some additional arguments that are not normally available but which make life easier when working with events: | |
* start_date is used to indicate the start of the date range you are interested in |
OlderNewer