Skip to content

Instantly share code, notes, and snippets.

View gugaalves's full-sized avatar

Guga Alves gugaalves

View GitHub Profile
@gugaalves
gugaalves / single-event.php
Last active February 11, 2020 21:44
[Plugin] The Events Calendar- Show event category in Monthly view
<?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
*
@gugaalves
gugaalves / gist:5be5a7bfba15c16ca5fe371aadae6fe5
Created September 17, 2021 19:39
Events Calendar [Free] [PRO] - Add Category Tags to List, Month and Map Views
// 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']
) : '';
@gugaalves
gugaalves / gist:3cee2f7acf67ec3e0229cbcb1417fbec
Created January 12, 2024 19:39
Events Calendar + Rank Math SEO: Noindex past events automatically
// 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()) {