Skip to content

Instantly share code, notes, and snippets.

View nefeline's full-sized avatar
:octocat:
Work, work!

Patricia Hillebrandt nefeline

:octocat:
Work, work!
View GitHub Profile
<?php
/**
* Dequeue tribe-events.min.js file.
* Date: 11/20/17
*/
add_action( 'wp_print_scripts', 'dequeue_tribe_events', 100 );
function dequeue_tribe_events() {
wp_dequeue_script( 'tribe-events-calendar-script' );
wp_deregister_script( 'tribe-events-calendar-script' );
@nefeline
nefeline / text_after_submission_button.php
Created November 20, 2017 11:11
Add Text after the "Submit Event" button in Community Events Submission Form
<?php
/**
* Add Text after the "Submit Event" button in Community Events Submission Form.
* Author: Patricia Hillebrandt
*/
add_action( 'tribe_events_community_section_after_submit', 'add_text_after_submit_button', 11, 2 );
function add_text_after_submit_button() {
echo nl2br( "\n Your Text" );
}
@nefeline
nefeline / single-event.php
Last active November 9, 2017 13:23
This is a template override that displays the start and end dates of recurring events in single-event.php
<?php
/**
* Modified Single Event Template
* A single event. This displays the event title, start and end dates for recurring events, description, meta, and
* optionally, the Google map for the event.
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php
*
* @package TribeEventsCalendar
* @version 4.6.3
@nefeline
nefeline / tooltip.php
Last active June 2, 2018 20:40
This template wraps the content of the month view tooltip with an event link
<?php
/**
* This template wraps the content of the month view tooltip with an event link (the entire tooptip links to your event, not just the excerpt links).
*
* Add this template on:
*
* [your-theme]/tribe-events/month/tooltip.php
*/
?>
@nefeline
nefeline / register_button.php
Created September 20, 2017 13:34
Creates a new Register button in CE login form
<?php
/**
* Create a new register button in Community Events Login Form.
*/
add_action('tribe_community_after_login_form', 'modern_tribe_register_button', 10, 2 );
function modern_tribe_register_button() {
wp_register( '<button id="register">', '</button>', true );
}
@nefeline
nefeline / add_css_single_event_pages.php
Last active September 18, 2017 19:44
Add CSS only in Single Event Pages.
<?php
/**
* This function adds specific CSS if the page is a Single Event.
*/
if( tribe_is_event() && is_single() ) {
?>
<style type="text/css">.header_hor .l-subheader-h, .l-titlebar-h, .l-main-h, .l-section-h, .l-subfooter-h, .w-tabs-section-content-h, .w-blog-post-body {
max-width: 1140px !important;
}</style>
<?php
@nefeline
nefeline / hide_div_if_is_single_event.php
Last active September 18, 2017 19:44
Hide specific div if the page is a Single Event
<?php
/**
* This function hides a specific div if the page is a Single Event.
*/
if( tribe_is_event() && is_single() ) {
?>
<style type="text/css">.title_subtitle_holder {
display: none !important;
}</style>
@nefeline
nefeline / tribe-events-ajax-maps.min.js
Created September 15, 2017 23:28
Displays the name of all events with the same venue in Google maps InfoWindow
/**
* @file This file contains all map view specific javascript.
* This file should load after all vendors and core events javascript.
* @version 3.0
*/
(function( window, document, $, td, te, tf, tg, ts, tt, config, dbug ) {
/*
* $ = jQuery
<?php
/**
* This function lists the Events Alphabetically
*/
add_filter( 'pre_get_posts', 'tribe_change_event_order', 99 );
function tribe_change_event_order( $query ) {
if ( tribe_is_past() || tribe_is_upcoming() || tribe_is_photo() ) {
$query->set( 'orderby', 'title' );
@nefeline
nefeline / excerpt_length.php
Created September 13, 2017 04:10
Change the events excerpt length
<?php
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );
function custom_excerpt_length( $length ) {
return 300;
}