Quickly disable all plugins in WordPress.
This plugin needs to go into the wp-content/mu-plugins/
directory. Provided you have SSH access to the server where WordPress lives, you can do this:
cd $SITE_ROOT/wp-content/mu-plugins
javascript:var s = document.createElement('script');s.type='text/javascript';document.body.appendChild(s);s.src='http://erkie.github.com/asteroids.min.js';void(0); |
<?php | |
/** Automatically append mtime to script and style versions for cache-busting action **/ | |
add_action( 'wp_enqueue_scripts', function() { | |
global $wp_styles, $wp_scripts; | |
foreach( array( 'wp_styles', 'wp_scripts' ) as $resource ) { | |
foreach( $$resource->registered as $name => $registered_resource ) { | |
// Not hosted here |
<?php | |
$path = str_replace( $_SERVER['DOCUMENT_ROOT'], '', dirname( $_SERVER['SCRIPT_FILENAME'] ) ); | |
$path_parts = explode( '/', $path ); | |
while ( count( $path_parts ) > 0 ) { | |
$path = $_SERVER['DOCUMENT_ROOT'] . implode( '/', $path_parts ) . '/wp-config.php'; | |
if ( file_exists( $path ) ) { | |
include( $path ); | |
break; | |
} else { | |
array_pop( $path_parts ); |
/* Smartphones (portrait and landscape) ----------- */ | |
@media only screen | |
and (min-device-width : 320px) | |
and (max-device-width : 480px) { | |
/* Styles */ | |
} | |
/* Smartphones (landscape) ----------- */ | |
@media only screen | |
and (min-width : 321px) { |
<?php | |
// Remove the default Genesis child theme CSS | |
remove_action( 'genesis_meta', 'genesis_load_stylesheet' ); | |
add_action( 'wp_enqueue_scripts', 'prefix_load_stylesheet' ); | |
/** | |
* Get the time the theme's CSS was last modified | |
* and use it to bust the cache by appending | |
* it to the CSS output. | |
* | |
* @author FAT Media |
Work in progress, I'll write this up properly when I'm done.
Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.
Prerequisites:
#!/bin/bash | |
# args | |
MSG=${1-'deploy from git'} | |
BRANCH=${2-'trunk'} | |
# paths | |
SRC_DIR=$(git rev-parse --show-toplevel) | |
DIR_NAME=$(basename $SRC_DIR) | |
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH |
<?php # -*- coding: utf-8 -*- | |
/** | |
* Plugin Name: Plugin Class Demo | |
* Description: How I am using the base class in plugins. | |
* Plugin URI: | |
* Version: 2012.09.29 | |
* Author: Fuxia Scholz | |
* License: GPL | |
* Text Domain: plugin_unique_name | |
* Domain Path: /languages |
<?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 |