Skip to content

Instantly share code, notes, and snippets.

@GeoffEW
GeoffEW / gist:88f728c6b6e0742aa29a
Created February 24, 2016 02:53
Smaller single image
.single-tribe_events .tribe-events-event-image img {max-width: 50%;}
.quantity input::-webkit-outer-spin-button, .quantity input::-webkit-inner-spin-button {
-webkit-appearance: inner-spin-button !important;
}
.quantity .input-text.qty {
width: 61px;
height: 62px;
padding: 0 5px;
text-align: center;
}
@GeoffEW
GeoffEW / gist:223fca6f45b78f2d1a42
Last active March 4, 2016 03:43
Removing extra comment block
.single-tribe_events #comments-block {display:none !important;}
.single-tribe_events #tribe-events-content #comments-block {display:block !important;}
@GeoffEW
GeoffEW / Ticket_Salest.txt
Last active March 9, 2016 19:34
Page template for ticket sales report
<?php
global $wpdb;
$results = $wpdb->get_results("SELECT p.post_title as product, pm.meta_value as total_sales FROM wp_posts AS p LEFT JOIN wp_postmeta AS pm ON (p.ID = pm.post_id AND pm.meta_key LIKE 'total_sales') WHERE p.post_type LIKE 'product' AND p.post_status LIKE 'publish'", 'ARRAY_A');
?>
<table>
<?php
foreach ( $results as $result ) { ?>
<tr>
<td style="padding: 20px 10px 10px;">
<p><?php echo $result['product']; ?> -</p>
@GeoffEW
GeoffEW / Revslider-slash-url-fix.php
Last active March 28, 2016 22:59
Fixes 404 message when events are displayed through Rev Slider and contain a "-" in the URL
<?php
/* to be placed in /wp-content/plugins/revslider/includes/slide.class.php */
if(isset($this->params['enable_link']) && $this->params['enable_link'] == “true” && isset($this->params['link_type']) && $this->params[‘link_type’] == “regular”){
/* The original code is this line */
$link = RevSliderFunctions::getVal($this->postData, 'link');
/* Fixed by JRB for tribe Event url containing dash */
$link = esc_url( get_permalink( $this->id ) );
$this->params[“link”] = str_replace(array(“%link%”, '{{link}}'), $link, $this->params[“link”]);
@GeoffEW
GeoffEW / enfold_attendee.php
Created June 6, 2016 16:07
Adds compatibility with Enfold for Attendee meta information
<?php
function add_custom_script(){
?>
<script>
(function($){
$(window).load(function() {
$('.quantity').on('click', 'input[type="button"]', function(){
$('.quantity input[type="text"]').trigger('keyup');
});
@GeoffEW
GeoffEW / eventbrite-fluid-iframe.php
Created June 10, 2016 06:20
Changes made around line 72 of /the-events-calendar-eventbrite-tickets/src/Tribe/Template.php to add a Fluidmedia class
<?php
<div class="eventbrite-ticket-embed fluidMedia" style="width: 100%%; text-align: left;"><iframe id="eventbrite-tickets-%1$s" style="width: 100%%; overflow: auto;" src="%2$s" width="300" height="150"></iframe></div>
<div style="font-family: Helvetica, Arial; font-size: 10px; padding: 5px 0 5px; margin: 2px; width: 100%%; text-align: left;"><a style="color: #ddd; text-decoration: none;" href="http://www.eventbrite.com/features?ref=etckt" target="_blank">Event registration</a>
@GeoffEW
GeoffEW / fix-oembed.php
Created June 27, 2016 22:38
Fix oEmbed Pro 4.2+
<?php
/**
* Avoid a problem with Events Calendar PRO 4.2 which can inadvertently
* break oembeds.
*/
function undo_recurrence_oembed_logic() {
if ( ! class_exists( 'Tribe__Events__Pro__Main' ) ) return;
$pro_object = Tribe__Events__Pro__Main::instance();
$pro_callback = array( $pro_object, 'oembed_request_post_id_for_recurring_events' );
@GeoffEW
GeoffEW / JSON_remove.php
Created July 13, 2016 01:44
Remove JSON LD from month view (performance temp fix)
<?php
/**
* Removes json LD from loading on month view
*/
function tribe_run_on_init( ) {
global $wp_filter;
if( tribe_is_month() ) {
@GeoffEW
GeoffEW / new_order_xtrainfo.php
Created July 21, 2016 19:03
Adds ticketed event information to WooCommerce "order confirmation" emails.
<?php
/**
* Adds ticketed event information to WooCommerce "order confirmation" emails.
*
* @param object $order
* @param bool $sent_to_admin
* @return void
*/
function add_attending_events_above_woo_order_info( $order, $sent_to_admin ) {
$line_items = $order->get_items( apply_filters( 'woocommerce_admin_order_item_types', 'line_item' ) );