Skip to content

Instantly share code, notes, and snippets.

@cliffordp
cliffordp / class-pt-customize-control-range.php
Last active August 29, 2015 14:27 — forked from primozcigler/class-pt-customize-control-range.php
Footer widgets layout customizer control.
<?php
/**
* Range Control Class
*/
class WP_Customize_Range_Control extends WP_Customize_Control {
/**
* @access public
* @var string
@cliffordp
cliffordp / q10.css
Last active August 26, 2015 20:19
q10 event list print styling for Twenty Fifteen theme
<style type="text/css" media="print">
.events-list.events-archive .tribe-events-list-event-description,
.events-list.events-archive #tribe-events-bar,
.events-list.events-archive #tribe-events-footer,
.events-list.events-archive a.tribe-events-button,
.events-list.events-archive header,
.events-list.events-archive footer {
display: none !important;
}
.events-list.events-archive .tribe-events-list .type-tribe_events {
@cliffordp
cliffordp / single-event-website-link-rel-nofollow.php
Created August 26, 2015 22:21
q7 --> add rel="nofollow" to a single event's "EVENT WEBSITE" -> "URL:" link
@cliffordp
cliffordp / gf-combine-to-timestamp.php
Created September 1, 2015 12:35
Combine several Gravity Forms form fields into a hidden "timestamp" form field using PHP's strtotime()
<?php
// USA timezones available at http://php.net/manual/en/timezones.america.php#114172 --> links to http://stackoverflow.com/questions/4989209/list-of-us-time-zones-for-php-to-use
/*
* change Gravity Forms date fields to timestamps, and do other formatting stuff as needed
* inspired by https://gist.github.com/norcross/2277175 or https://gist.github.com/BronsonQuick/2834114
* https://www.gravityhelp.com/documentation/article/gform_pre_submission/
*/
// http://php.net/manual/en/function.date.php
// Make two fields of type 'Hidden' (NOT visibility -> Admin-only) on your GF form
@cliffordp
cliffordp / style.less
Last active September 4, 2015 16:20
A fix for J.K. for PageLines DMS third-party Single Bits section's link color inherit
// Fix .section-elsue-single-bits a { color: inherit; } making links the same color as regular text
#site .section-elsue-single-bits a {
color: #1C5E91; // or the LESS Variable @pl-link if that's the same
&:hover {
color: #40BBBF; // could use another LESS variable like @linkColorHover
}
&:visited {
color: #647875; // could use LESS variable if set -- or even something like darken( @pl-link, 10% );
}
}
@cliffordp
cliffordp / functions.php
Last active May 9, 2017 05:57
Display Ticket image on event single page
<?php
// https://gist.github.com/cliffordp/013e3e43a3f3bca9b7cc
add_action( 'tribe_events_single_event_before_the_meta', 'forum_1005858_ticket_header_img' );
/*
could use different actions to output to different places on event single page
-- see /wp-content/plugins/the-events-calendar/src/views/single-event.php for more actions
-- also listed below:
tribe_events_single_event_before_the_content
tribe_events_single_event_after_the_content
@cliffordp
cliffordp / functions.php
Last active June 6, 2023 05:38
How to remove (dequeue) The Events Calendar's and PRO's styles.
<?php
// If you use this snippet as-is, ALL of The Events Calendar (i.e. "Core") and Pro add-on styles will NOT be loaded.
// (although there may be some $handles that I didn't detect... especially from widgets, shortcodes, and the like... no guarantess ;-)
// Comment out the line of each style you DO want to load.
// Note the comments within each array regarding the Display style options -- https://theeventscalendar.com/knowledgebase/wp-admin-settings-overview/#display
// The Display styles are "stacked".
// In other words, the Skeleton files are always loaded, and the Full styles are loaded when Tribe Events Styles (i.e. Theme) is selected.
// However, the commented .css example file names can change, e.g. 'full.min.css' instead of 'skeleton.min.css' or 'theme-mobile.min.css' instead of 'full-mobile.min.css'
//
@cliffordp
cliffordp / functions.php
Created October 7, 2015 23:19
Override Mini-Calendar Widget -- output month name abbreviation instead of day name abbreviation -- e.g. change "Sat" to "Oct"
<?php
// http://theeventscalendar.com/support/forums/topic/events-list-widget-not-showing-the-month-just-day-name-and-day-number/
//
// Mini-Calendar Widget: /wp-content/plugins/events-calendar-pro/src/views/pro/widgets/modules/single-event.php
// output month name abbreviation instead of day name abbreviation
// e.g. change "Sat" to "Oct"
add_filter( 'tribe-mini_helper_tribe_events_ajax_list_dayname', 'cliff_1011625_mini_cal_month_instead_of_day_of_week' );
function cliff_1011625_mini_cal_month_instead_of_day_of_week( $postDate ) {
return date_i18n( 'M', strtotime( $postDate ) ); // changing from 'D' to 'M' -- could also use any other date format from http://php.net/manual/en/function.date.php
<?php
function tec_1019677_dequeue_geoloc_script() {
wp_dequeue_script( 'tribe-events-pro-geoloc' );
}
add_action( 'wp_print_scripts', 'tec_1019677_dequeue_geoloc_script', 100 );
<?php
add_action( 'tribe_events_single_event_after_the_content', 'forum_1020203_custom_content' );
/*
could use different actions to output to different places on event single page
-- see /wp-content/plugins/the-events-calendar/src/views/single-event.php for more actions
-- also listed below:
tribe_events_single_event_before_the_content
tribe_events_single_event_after_the_content
tribe_events_single_event_before_the_meta
tribe_events_single_event_after_the_meta