Skip to content

Instantly share code, notes, and snippets.

View BeardedGinger's full-sized avatar

Josh Mallard BeardedGinger

View GitHub Profile
<?php
add_filter( 'register_post_type_args', 'lc_change_registered_post_type_slug', 10, 2 );
/**
* Change the slug for a registered post type.
*
* @param array $args Array of arguments for registering a post type.
* @param string $post_type Post type key.
*/
function lc_change_registered_post_type_slug( $args, $post_type ) {
@BeardedGinger
BeardedGinger / filter_event_list_query_args.php
Last active September 6, 2016 16:56
Filter event list query for The Events Calendar plugin to show events that start 30 days from now
<?php
add_filter( 'tribe_events_list_widget_query_args', 'jm_filter_list_widget_query_args' );
/**
* Filter the query used for the Event List Widget to show only events starting
* in the future
*/
function jm_filter_list_widget_query_args( $args ) {
$offset = 86400 * 30;
$date = date( 'U' ) + $offset;
<?php
/**
* Plugin Name: Reverse Proxy for WordPress Multisite
* Plugin URI: https://limecuda.com/
* Description: Reverse proxy setup for a WordPress multisite in subdirectory mode
* Version: 1.0.0
* Author: Josh Mallard
* Author URI: https://limecuda.com
*
* @package reverse-proxy-wp-multisite
@BeardedGinger
BeardedGinger / remove-genesis-blogpage-settings.php
Last active October 6, 2016 02:25
Remove the Genesis Blog Page settings from the Genesis Theme Settings page
<?php
add_action( 'toplevel_page_genesis_settings_page_boxes', 'lc_remove_unwanted_genesis_metaboxes' );
/**
* Remove the blog page settings metabox from the Genesis Theme Settings
* Desired if following the suggestion by Bill Erickson to not use the Blog page template
* that comes standard in the Genesis Theme
*
* @link http://www.billerickson.net/dont-use-genesis-blog-template/
*/
function lc_remove_unwanted_genesis_metaboxes() {
<?php
/**
* For use with the Owner/Author Ad Split plugin
*
* @link https://wordpress.org/plugins/ownerauthor-ad-split-for-genesis/
*/
add_filter( 'below_content_ad_priority','move_below_default_ad' );
/**
* Moves the below content ad above the content and below the post image
@BeardedGinger
BeardedGinger / term-description.php
Created September 18, 2015 09:28
Add Term Description to event category archive
<?php
/**
* Copy the "src/views/list/content.php" file from the Core TEC plugin
*
* Paste it into your theme at "tribe-events/list/content.php"
*
* Place the following snippet in the new file within your theme wherever you
* would like the it to display.
*/
<?php
$venue_categories = wp_get_post_terms( $venue_id, 'tribe_venue_category' );
if( !empty($venue_categories) ) {
foreach($venue_categories as $category) {
echo $category->name;
}
}
<?php
/**
* Allows visitors to page forward/backwards in any direction within month view
* an "infinite" number of times (ie, outwith the populated range of months).
*/
if ( class_exists( 'Tribe__Events__Main' ) ) {
class ContinualMonthViewPagination {
public function __construct() {
<?php
add_action( 'init', 'tribe_remove_venue_dropdown' );
function tribe_remove_venue_dropdown() {
$callback = array( Tribe__Events__Main::instance(), 'displayEventVenueDropdown' );
remove_action( 'tribe_venue_table_top', $callback );
}
<?php
$additional_data = array();
$event_id = get_post_meta( get_the_ID(), '_EventVenueID' );
$venue_city = get_post_meta( $event_id, '_VenueCity' );
$additional_data['city'] = $venue_city;
?>