Skip to content

Instantly share code, notes, and snippets.

View jo-snips's full-sized avatar

Jonah West jo-snips

View GitHub Profile
<?php
/**
* update ~line 26 to include 2 argument params as such:
*/
add_filter( 'posts_orderby', array( __CLASS__, 'events_search_orderby' ), 10, 2 );
/**
* update static function `events_search_orderby` (replace with the following method starting at ~line 159)
*/
@jo-snips
jo-snips / body-classes.php
Created November 14, 2013 19:51
WordPress - Dynamic Browser Body Classes
/*-----------------------------------------------------------------------------------*/
/* Adds new body classes
/*-----------------------------------------------------------------------------------*/
add_filter('body_class', 'add_browser_classes');
function add_browser_classes($classes){
if(is_singular()) {
global $post;
$classes[] = $post->post_name;
}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
// Customize Events Community Datepicker
if($("div.tribe-community-events-date input.datepicker").length) {
var datepickerOpts = {
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
onSelect: function(selectedDate) {
var option = this.id == "EventStartDate" ? "minDate" : "maxDate";
var instance = $(this).data("datepicker");
var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
@jo-snips
jo-snips / font-awesome-plain-text.txt
Last active July 23, 2016 23:44
Font Awesome Plain Text List
adjust
adn
align-center
align-justify
align-left
align-right
ambulance
anchor
android
angle-down
@jo-snips
jo-snips / filter_query_arg.php
Created July 16, 2013 19:20
The Events Calendar - Filter Query Args For Genesis Responsive Slider
<?php
add_filter('genesis_responsive_slider_query_args', 'custom_genesis_responsive_slider_query_args');
function custom_genesis_responsive_slider_query_args($query_args) {
$term_args = array( );
if ( 'page' != genesis_get_responsive_slider_option( 'post_type' ) ) {
if ( genesis_get_responsive_slider_option( 'posts_term' ) ) {
@jo-snips
jo-snips / filter_website_link.php
Created July 15, 2013 23:30
The Events Calendar - Filter Website Link
<?php
add_action( 'init', 'tribe_events_wootheme_compatibility' );
function tribe_events_wootheme_compatibility() {
if ( ! is_home() ) {
remove_filter( 'pre_get_posts', 'woo_exclude_categories_homepage', 10 );
}
}
@jo-snips
jo-snips / fix_page_not_found_title.php
Created July 9, 2013 23:29
The Events Calendar - Fix Page Not Found Title
<?php
add_action('template_include', 'avoid_404_event_titles', 1);
function avoid_404_event_titles() {
global $wp_query;
if (property_exists($wp_query, 'tribe_is_event') && $wp_query->tribe_is_event and $wp_query->is_404)
$wp_query->is_404 = false;
}