Skip to content

Instantly share code, notes, and snippets.

Clifford cliffordp

  • Oklahoma
View GitHub Profile
@cliffordp
cliffordp / functions.php
Last active Jan 10, 2019
The Events Calendar: Display WordPress custom fields in the Item Details part of the List Venues Organizers Shortcode extension.
View functions.php
<?php
/**
* The Events Calendar: Display WordPress custom fields in the Item Details part of the
* List Venues Organizers Shortcode extension.
*
* Excludes hidden fields (beginning with `_`) and Elegant Theme's hidden fields (beginning with `et_`).
* Authored by Richard of memberwise.org.uk and Clifford (Tribe Support).
*
* @link https://gist.github.com/cliffordp/a6cff51ed56276641c4d4ea0a82b25b9 This snippet.
* @link https://theeventscalendar.com/extensions/list-venues-and-organizers-shortcodes/ Extends this extension.
@cliffordp
cliffordp / functions.php
Last active Jan 10, 2019
The Events Calendar: Remove the month, day, and datetime separator from an event's start time display.
View functions.php
<?php
/**
* The Events Calendar: Remove the month, day, and datetime separator from an event's start time display.
*
* Example:
* Before: <span class="tribe-event-date-start">January 31 @ 10:30 pm</span> - <span ...
* After: <span class="tribe-event-date-start">10:30 pm</span> - <span ...
* DOES NOT APPLY WHEN USING WordPress 5's BLOCK EDITOR. For block editor, just use this CSS:
* .tribe-events-schedule__datetime > .tribe-events-schedule__date--start,
* .tribe-events-schedule__datetime > .tribe-events-schedule__separator--date {
@cliffordp
cliffordp / functions.php
Last active Jan 8, 2019
Divi: Disable Open Sans Google Font.
View functions.php
<?php
/**
* Divi: Disable Open Sans Google Font.
*
* @link https://gist.github.com/cliffordp/6c4bad206828ce559cdee290bfcec020 This snippet.
* @link https://designsbytierney.com/2017/06/optimize-google-font-delivery-wordpress-divi-theme/ Related advice for Elegant Themes users.
*/
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'divi-fonts' );
}, 20 );
@cliffordp
cliffordp / functions.php
Last active Jan 6, 2019
Divi theme: Remove the link to each Portfolio item within Filterable Portfolio.
View functions.php
<?php
/**
* Divi theme: Remove the link to each Portfolio item within Filterable Portfolio.
*
* @link https://gist.github.com/cliffordp/e6dfd8c9533ae4b31d4c3b8ffb6dce8d This snippet.
*/
add_action( 'wp_footer', function () {
if ( ! class_exists( 'ET_Builder_Module_Filterable_Portfolio' ) ) {
return;
@cliffordp
cliffordp / functions.php
Created Dec 28, 2018
The Events Calendar: Remove the `tribe-event-featured` class from Mini Calendar widgets.
View functions.php
<?php
/**
* The Events Calendar: Remove the `tribe-event-featured` class from Mini Calendar widgets.
*
* @link https://gist.github.com/cliffordp/822336f011df7d8106a1e13f6f7d7226 This snippet.
*/
function cliff_tribe_remove_featured_class_from_mini_widget() {
wp_enqueue_script( 'jquery' );
?>
<script>
@cliffordp
cliffordp / functions.php
Last active Dec 16, 2018
Event Tickets: Set the maximum quantity allowed per ticket.
View functions.php
<?php
/**
* Event Tickets: Set the maximum quantity allowed per ticket.
*
* !!! Change the maximum to your own !!! Needs to be higher than priority 10 because of
* Tribe__Tickets_Plus__Commerce__WooCommerce__Main::filter_ticket_max_purchase()
* Does not work for unlimited stock WooCommerce Tickets until https://central.tri.be/issues/119822 is fixed.
*
* @param int $available Max Purchase number
@cliffordp
cliffordp / functions.php
Created Dec 3, 2018
The Events Calendar: All Venue slugs get prefixed with a custom string. Works in wp-admin and Community Events.
View functions.php
<?php
/**
* The Events Calendar: All Venue slugs get prefixed with a custom string. Works in wp-admin and Community Events.
*
* !!! Change the prefix to your own !!!
*
* @link https://gist.github.com/cliffordp/ac4a68769787352369ab0c5e41dc28ab This snippet.
*/
function cliff_prefix_venue_slugs( $data ) {
// TODO: Change this to what you want!!!
@cliffordp
cliffordp / functions.php
Last active Nov 21, 2018
Events Calendar PRO: Set the "Show only the first instance of each recurring event (only affects list-style views)" option only on certain page/post IDs.
View functions.php
<?php
/**
* Events Calendar PRO: Set the "Show only the first instance of each recurring event (only affects list-style views)"
* option only on certain page/post IDs.
*
* Useful if you are embedding a List View within a specific page, such as via shortcode or widget, and you want to hide
* the recurrences ONLY in this context.
* !!! CHANGE TO YOUR OWN POST IDs WITHIN THIS SNIPPET'S CODE !!!
*
* @link https://gist.github.com/cliffordp/69d00ce54929393410e27a319762d241 This snippet.
@cliffordp
cliffordp / style.css
Last active Nov 19, 2018
TEC Month View: blackout all July Fourths, since the library is closed. Screenshot: https://cl.ly/ad0626fcb03e
View style.css
/**
* TEC Month View: blackout all July Fourths, since the library is closed.
* Screenshot: https://cl.ly/ad0626fcb03e
* From: https://gist.github.com/cliffordp/90757a9fccc5b19431be12fa49839b49
*/
#tribe-events .tribe-events-month td[data-day$="07-04"],
#tribe-events .tribe-events-month td[data-day$="07-04"]:hover,
#tribe-events .tribe-events-month td[data-day$="07-04"] a,
#tribe-events .tribe-events-month td[data-day$="07-04"] a:hover,
#tribe-events .tribe-events-month td[data-day$="07-04"] h3,
@cliffordp
cliffordp / functions.php
Created Nov 10, 2018
Pseudo code for putting the WooCommerce Bookings Form anywhere, such as via a shortcode. READ THE CODE COMMENTS
View functions.php
<?php
/**
* Pseudo code for putting the WooCommerce Bookings Form anywhere, such as via a shortcode.
* !!! READ THE CODE COMMENTS !!!
*
* @link http://ideas.woocommerce.com/forums/133476-woocommerce/suggestions/34526179-creating-shortcode-booking-search-form-with-date-r
*
* @see WC_Booking_Cart_Manager::add_to_cart()
*
You can’t perform that action at this time.