Skip to content

Instantly share code, notes, and snippets.

@courtneymyers
courtneymyers / acf_modifications.php
Created February 28, 2018 18:36
Reduces initial height of Advanced Custom Fields WYSIWYG fields to 100px, and enables autoresizing of WYSIWYG field, as text is entered. Best practice would be to include this function in a site-specific plugin.
<?php
/*
* -----------------------------------------------------------------------------
* Advanced Custom Fields Modifications
* -----------------------------------------------------------------------------
*/
function PREFIX_apply_acf_modifications() {
?>
<style>
@cliffordp
cliffordp / functions.php
Last active August 23, 2018 05:03
Events Calendar PRO: Remove Post Tags from the related posts logic and, therefore, only use Event Categories.
<?php
/**
* Events Calendar PRO: Remove Post Tags from the related posts logic and,
* therefore, only use Event Categories.
*
* @see tribe_get_related_posts()
*
* @link https://gist.github.com/cliffordp/6a66affeab8ac57d7ceea942f8c417ff
*
@cliffordp
cliffordp / functions.php
Last active April 6, 2023 15:36
The Events Calendar: Remove the Organizers post type from Events
<?php
/**
* The Events Calendar: Remove the Organizers post type from Events.
*
* Replace instances of ORGANIZER_POST_TYPE with VENUE_POST_TYPE if you
* want to do so for Venues instead.
*
* @link https://theeventscalendar.com/knowledgebase/linked-post-types/
* @link https://gist.github.com/a521d02facbc64ce3891c9341384cc07
@prasetyop
prasetyop / admin.css
Last active March 13, 2023 13:33
Flexible Content Preview Pop Up
.acf-fc-popup .preview {
position: absolute;
right: 100%;
margin-right: 0px;
top: 0;
background: #383c44;
min-height: 100%;
border-radius: 5px;
align-content: center;
display: grid;
@cliffordp
cliffordp / functions.php
Last active August 23, 2018 05:14
The Events Calendar: Turn the "All Events" link into a true "Back" button.
<?php
/**
* The Events Calendar: Turn the "All Events" link into a true "Back" button.
*
* Generally not advisable but provided at customer's request:
* https://theeventscalendar.com/support/forums/topic/upcoming-events-8/
*
* @link https://gist.github.com/cliffordp/60b5acf003fa68ad7803313d662c08e7
* @link https://css-tricks.com/snippets/javascript/go-back-button/
* @link https://api.jquery.com/replacewith/
@cliffordp
cliffordp / functions.php
Last active August 23, 2018 05:15
The Events Calendar: Redirect all site searches to be Tribe Bar Keyword searches.
<?php
/**
* The Events Calendar: Redirect all site searches to be Tribe Bar Keyword searches.
*
* Should only be used if you want only Event posts to appear in general search
* queries. Again, Posts, Pages, and custom post types allowed to appear in
* search results will no longer be included--ONLY Events will appear.
* Example redirect:
* From: http://example.dev/?s=Weekly+Screening
* To: http://example.dev/events/?tribe-bar-search=Weekly%20Screening
@cliffordp
cliffordp / functions.php
Last active August 23, 2018 05:16
The Events Calendar - Filter Bar: Redirect all Post Tags to their Event view.
<?php
/**
* The Events Calendar - Filter Bar: Redirect all Post Tags to their Event view.
*
* Does not work if Filter Bar is not active. Should only be used if you use
* Post Tags *solely* for Events and not for Posts. Example redirect:
* From: http://example.dev/tag/around-the-house/
* To: http://example.dev/events/?tribe_tags[]=53
*
@vicskf
vicskf / functions.php
Last active September 16, 2020 05:02
TEC - Filter Bar plugin > Always show open filters in mobile views
<?php
/**
* Filter Bar plugin
* Always show open filters in mobile views
* Author: Barry Hughes
*/
add_action( 'wp_footer', function() {
if (
! class_exists( 'Tribe__Events__Filterbar__View' )
@rmorse
rmorse / filter-sf-pro-query.php
Last active January 7, 2024 03:09 — forked from dryan1144/filter-sf-pro-query.php
This modifies the $query_args object (rather than replacing it, which removes all the settings that are already in the object created by S&F).
<?php
function hck_filter_taxonomy_archives( $query_args, $sfid ) {
if( $sfid == 509 ) {
$query_args['post_type'] = 'articles';
}
return $query_args;
}
@cliffordp
cliffordp / functions.php
Last active February 20, 2024 13:36
The Events Calendar - Get the next upcoming Featured Event
<?php
/**
* The Events Calendar - Get the next upcoming Featured Event
*
* Notes:
* 1) Ignores all-day events.
* 2) For the date comparison, this code assumes each event is in
* the same timezone as your WordPress General Settings timezone.
*