Skip to content

Instantly share code, notes, and snippets.

@andrasguseo
andrasguseo / functions.php
Last active April 24, 2020 16:42
Hide the quantity field on the WooCommerce cart page
<?php
/*
* For the following plugins:
* The Events Calendar, Event Tickets, Event Tickets Plus, WooCommerce
*
* The function hides the quantity form field from the cart page
* so users cannot change the product / ticket quantity there.
* It shows the number as plain text.
* Note: it only allows you to put 1 of all products in the cart!!!
* Useful if you are collecting attendee information with Event Tickets Plus
@andrasguseo
andrasguseo / additional-fields.php
Last active August 21, 2018 11:06
For Monique - template override for showing values of additional fields in separate lines vs. comma separated list
<?php
/**
* Single Event Meta (Additional Fields) Template Override
* for showing values of additional fields in separate lines
* vs. comma separated list
*
* Copy this template in your own theme by creating a file at:
* [your-theme]/tribe-events/pro/modules/meta/additional-fields.php
*
* @package TribeEventsCalendarPro
@andrasguseo
andrasguseo / functions.php
Created October 31, 2016 21:00
For Robert - Show only today's events in all views, when there is no filtering for date
<?php
/*
* For the following plugins:
* The Events Calendar
*
* With this snippet you will only see today's events in any
* calendar view, if there is no date set in the filter bar.
* If there are no events, then "There were no results found."
* is shown.
* Add to your child theme's functions.php file
@andrasguseo
andrasguseo / functions.php
Last active November 8, 2016 22:46
For Fernanco - Add "billing company name" to CSV export of Attendees
<?php
/**
* Add billing company name to CSV export
*/
function tribe_csv_export_add_company_column ( $columns ){
return array_merge ( $columns, array('company' => 'Company') );
}
@andrasguseo
andrasguseo / functions.php
Last active November 30, 2016 15:53
Modify query order when including events in blog post loop
/*
* Template to modify query order when including events in blog post loop
* For The Events Calendar
* Paste into functions.php
*/
add_action( 'pre_get_posts', 'order_by_modified' );
function order_by_modified( $query ) {
if ( $query->is_home() && $query->is_main_query() ) {
@andrasguseo
andrasguseo / et-meta-hawk.php
Created November 30, 2016 15:44
Event Tickets Meta Hawk by Barry
<?php
/**
* Plugin name: Event Tickets Meta Hawk
* Description: Lets site administrators soar over attendee meta data supplied by attendees then swoop down, hawk-like, to change it. Proof of concept targeting the WooCommerce provider.
* Version: 2016-03-21
* Author: Barry Hughes
*
* Experiment in making attendee meta editable via the attendee screen.
* Well worth bearing in mind that:
*
@andrasguseo
andrasguseo / tec-hide-weekend.css
Last active December 22, 2016 23:54
Hide Saturday and Sunday in month view in The Events Calendar
.tribe-events-month .tribe-events-calendar thead th:nth-child(6),
.tribe-events-month .tribe-events-calendar thead th:nth-child(7),
.tribe-events-month .tribe-events-calendar tbody td:nth-child(6),
.tribe-events-month .tribe-events-calendar tbody td:nth-child(7) {
display: none;
}
@andrasguseo
andrasguseo / remove-feeds.php
Last active June 4, 2020 20:25
Remove feed code
<?php
/* Barry's version */
/* Remove feeds from all pages */
function remove_single_event_feed_links() {
if ( ! class_exists( 'Tribe__Events__Main' ) ) {
return;
}
// Add / Uncomment these lines if you only want them removed on the single event pages.
@andrasguseo
andrasguseo / eventbrite-iframe.php
Created January 31, 2017 10:51
Render EventBrite iFrame on event page when EventBrite event is set to private
<?php
/*
* For The Events Calendar and The Events Calendar: EventBrite Tickets
* Renders the EventBrite iFrame on single event page when EventBrite event is set to private
* Author: Barry Hughes
*/
function eb_iframe_show_even_if_private() {
$post_id = get_the_ID();
$api = tribe( 'eventbrite.api' );
@andrasguseo
andrasguseo / show-all-events-from-cat.php
Last active February 6, 2017 10:03
For Chad - show all events of a category, despite the ‘Hide From Event Listings’ being checked
<?php
$events = tribe_get_events(
array(
'eventDisplay' => 'list',
'posts_per_page' => 3,
'tax_query' => array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => $group_slug,