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
// That snippet was tested using the following plugin versions: | |
// The Events Calendar v6.2.9 | |
// Rank Math SEO v1.0.210 | |
// Check if Events Calendar and Rank Math plugins are enabled | |
if (class_exists('Tribe__Events__Main') && class_exists('RankMath')) { | |
add_filter( 'rank_math/frontend/robots', function( $robots ) { | |
global $post; | |
if (!is_admin() && is_singular() && @$post->post_type == 'tribe_events') { | |
if (strtotime(tribe_get_end_date($post->ID, true, 'r')) < time()) { |
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
// Source: https://theeventscalendar.com/knowledgebase/k/add-category-tags-to-list-view/ | |
// Remove "Event Categories" label from tribe_get_event_categories function | |
function tec_remove_category_label( $html, $post_id, $args, $categories ) { | |
$html = ! empty( $categories ) ? sprintf( | |
'%s%s%s', | |
$args['wrap_before'], | |
$categories, | |
$args['wrap_after'] | |
) : ''; | |
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 | |
/** | |
* Month Single Event | |
* This file contains one event in the month view | |
* | |
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/month/single-event.php | |
* | |
* @package TribeEventsCalendar | |
* @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 |
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
// 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
/* | |
* | |
* 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
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
//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
<?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; | |
} | |
?> |
NewerOlder