Skip to content

Instantly share code, notes, and snippets.

View jtsternberg's full-sized avatar
😎
Awesome Motive-ing

Justin Sternberg jtsternberg

😎
Awesome Motive-ing
View GitHub Profile
var some_var = 'something';
var func = function() {
console.log( some_var ); // logs "something"
};
func();

Disable Plugins

Quickly disable all plugins in WordPress.

Usage

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
@jtsternberg
jtsternberg / wdscamp_noms.md
Last active September 21, 2015 19:28 — forked from ramiabraham/wdscamp_noms.md
[wdscamp 2015 wednesday dinner]

Chana Masala

feed like 5-6 people

  • 1 (15 ounce) can chickpeas
  • 1 onion, chopped
  • 1 tomatoes, chopped
  • 1 green chili pepper, chopped
  • 4 -5 garlic cloves, chopped
  • 1 inch gingerroot, chopped
@jtsternberg
jtsternberg / nothing.php
Created February 15, 2012 16:13 — forked from wpsmith/nothing.php
Trying to add "last-post" class to the loop
$post_classes = get_post_class();
$odd_or_even = 'even';
$post_counter = 0;
$post_counter++;
$odd_or_even = ( 'odd' == $odd_or_even ) ? 'even' : 'odd';
$post_classes[] = ( $post_counter == count( $posts ) ) ? 'last-post' :$odd_or_even;
echo '<div class="' . implode( ' ', $post_classes ) . '">';
@jtsternberg
jtsternberg / radio-latest-news-widget.php
Created February 15, 2012 16:15
Trying to add "last-post" class to the loop
<?php
/**
* Adds Radio Latest News Widget.
*
* @package Radio
* @package Widgets
* @author Greg Rickaby and StudioPress
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link http://www.studiopress.com/themes/genesis
*/
@jtsternberg
jtsternberg / radio-latest-news-widget.php
Created February 15, 2012 19:06 — forked from gregrickaby/radio-latest-news-widget.php
If there's no content, don't display [Continue...]
<?php
/**
* Adds Radio Latest News Widget.
*
* @package Radio
* @package Widgets
* @author Greg Rickaby and StudioPress
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link http://www.studiopress.com/themes/genesis
*/
@jtsternberg
jtsternberg / radio-latest-news-widget.php
Created February 15, 2012 19:20 — forked from gregrickaby/radio-latest-news-widget.php
If there's no content, don't display [Continue...]
<?php
/**
* Adds Radio Latest News Widget.
*
* @package Radio
* @package Widgets
* @author Greg Rickaby and StudioPress
* @license http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
* @link http://www.studiopress.com/themes/genesis
*/
@jtsternberg
jtsternberg / radio-latest-news-widget.php
Created February 15, 2012 19:17 — forked from wpsmith/radio-latest-news-widget.php
If there's no content, don't display [Continue...]
if ( ! empty( $instance['show_content'] ) ) {
if ( 'excerpt' == $instance['show_content'] )
the_excerpt();
elseif ( 'content-limit' == $instance['show_content'] && strip_shortcodes( $post->post_content ) != '' ) {
the_content_limit( (int) $instance['content_limit'], esc_html( $instance['more_text'] ) );
}
else
the_content( esc_html( $instance['more_text'] ) );
}
@jtsternberg
jtsternberg / radio-latest-news-widget.php
Created February 15, 2012 19:30 — forked from wpsmith/radio-latest-news-widget.php
If there's no content, don't display [Continue...]
if ( ! empty( $instance['show_content'] ) ) {
if ( 'excerpt' == $instance['show_content'] ) {
the_excerpt();
} elseif ( 'content-limit' == $instance['show_content'] {
if ( strip_shortcodes( get_the_content() ) != '' ) {
the_content_limit( (int) $instance['content_limit'], esc_html( $instance['more_text'] ) );
} elseif ( get_the_content() != '' && strip_shortcodes( get_the_content() ) == '' ) {
// do nothing
}
} else {
@jtsternberg
jtsternberg / front.php
Created February 16, 2012 15:58
If the option is empty, don't display
<?php if ( $station_phone = genesis_get_option( 'station_phone' ) ) { ?>
<div class="live-toolbar-phone alignright">
<span>Request Line: <?php echo $station_phone; ?></span>
</div>
<?php } ?>