Skip to content

Instantly share code, notes, and snippets.

View lepittenger's full-sized avatar

Lauren Levin (Pittenger) lepittenger

View GitHub Profile
@lepittenger
lepittenger / back to current month.php
Created February 22, 2016 23:14 — forked from theeventscalendar/back to current month.php
Adds a Back to Current Month link at the bottom of the calendar
<?php if ( date_i18n( 'Y-m-01' ) !== tribe_get_month_view_date() ) : ?>
<li class="tribe-events-nav-current">
<a href="<?php echo Tribe__Events__Main::instance()->getLink( 'month' ) ?>">Back to Current Month</a>
</li>
<?php endif ?>
// We want to adapt the names of views listed within the Tribe Events Bar
add_filter( 'tribe-events-bar-views', 'rename_tribe_views_in_selector', 100 );
function rename_tribe_views_in_selector( $views ) {
// This lists the original view names you wish to change along
// with the substitutes to wish to use in their place
$to_change = array(
'List' => 'All Events',
'Month' => 'Calendar',
'Photo' => 'Picture Board',
@lepittenger
lepittenger / functions.php
Created February 22, 2016 23:06
favicon for WordPress admin dashboard
// favicon for admin dashboard
function admin_favicon() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="' . get_bloginfo( 'stylesheet_directory' ) . '/images/favicon-admin.ico" />';
}
add_action( 'admin_head', 'admin_favicon' );
@lepittenger
lepittenger / functions.php
Last active February 22, 2016 23:05
Customize Genesis footer
//* Customize the entire footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'highspire_custom_footer' );
function highspire_custom_footer() {
?>
<p>&copy; Copyright 2012 - <?php echo date('Y'); ?> <a href="<?php echo get_bloginfo('url'); ?>"><?php echo get_bloginfo('name'); ?></a>, all rights reserved. Site by me, of course.</p>
<?php
}
@lepittenger
lepittenger / gist:f798c999942af4b1e6a1
Last active February 22, 2016 18:07
CSS: Select every third item starting at #4
&:nth-child(3n+4) {
// do it only to every third item starting with #4.
}
@lepittenger
lepittenger / One Div Coffee.markdown
Last active December 22, 2015 03:42
One Div Coffee
@lepittenger
lepittenger / exceptions.php
Last active August 29, 2015 14:25
Lauren Learns PHP
<?php
// Object Oriented PHP Basics
try {
// this is where the code we want to test goes
} catch (Exception $e) {
// Inspect $e
$e->getMessage(); // gets message that was passed into the exception constructor when the exception was thrown
@lepittenger
lepittenger / functions.php
Created June 23, 2015 20:12
Enqueue Google Font Weights
add_action( 'wp_enqueue_scripts', 'enqueue_google_fonts' );
function enqueue_google_fonts() {
// Get the theme data, so we can handle stylesheet versioning in one place
$theme = wp_get_theme();
// Enqueue the Google fonts
$font_url = add_query_arg( 'family', urlencode( 'Cabin:400,700' ), '//fonts.googleapis.com/css' );
wp_enqueue_style( 'google_font_cabin', $font_url, array(), $theme->Version );
@lepittenger
lepittenger / wp-config.php
Created June 23, 2015 20:07
Email Only Editors with Revisionary Plugin
define( 'SCOPER_MONITOR_ROLES', 'editor' );