Skip to content

Instantly share code, notes, and snippets.

View tamarazuk's full-sized avatar
👩‍💻

Tamara Zuk tamarazuk

👩‍💻
View GitHub Profile
@tamarazuk
tamarazuk / 0_reuse_code.js
Created June 3, 2014 05:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/*-----------------------------------------------------------------------------------*/
/* Conditional Logic to Detect Various Event Related Views/Pages
/*-----------------------------------------------------------------------------------*/
if( tribe_is_month() && !is_tax() ) { // Month View Page
echo 'were on the month view page';
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
<?php
if (!is_blog_installed()) { return; }
if ('http://' . $_SERVER['SERVER_NAME'] . '/wp' == get_option('home')) {
update_option('siteurl', 'http://' . $_SERVER['SERVER_NAME'] . '/wp');
update_option('home', 'http://' . $_SERVER['SERVER_NAME']);
update_option('upload_path', $_SERVER['DOCUMENT_ROOT'] . '/media');
update_option('upload_url_path', 'http://' . $_SERVER['SERVER_NAME'] . '/media');
update_option('permalink_structure', '/%postname%/');
}
<?php
/*
Plugin Name: Disable Plugins
Description: Disables plugins that you specify depending on the value of the WP_LOCAL_DEV constant
Version: 0.2
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/