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
@jtsternberg
jtsternberg / single-subscription.php
Created February 14, 2014 14:47
DRY method to loop through some meta keys and give them unique titles
<?php
$post_id = get_the_ID();
$meta_info = array(
'ms_pitch_1' => 'Pitch Title',
'ms_pitch_2' => 'Another Pitch Title',
'ms_pitch_3' => 'Yet Another',
'ms_pitch_4' => 'Yawn',
'ms_pitch_5' => 'Wat',
'ms_pitch_6' => 'Pitch Title 6',
);
@jtsternberg
jtsternberg / jetpack-is-genesis.php
Created March 17, 2014 03:13
code being used to enable Jetpack's IS at http://photos.jtsternberg.com/
<?php
// Jetpack infinite scroll
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'footer' => 'nav',
'render' => 'jt_render_infinite_scroll',
) );
function jt_render_infinite_scroll() {
do_action( 'genesis_before_loop' );
<?php
/**
* AppPresser Theme Theme Customizer
*
* @package AppPresser Theme
* @since 0.0.1
*/
add_action( 'customize_register', 'add_theme_mod' );
function add_theme_mod( $wp_customize ) {

Keybase proof

I hereby claim:

  • I am jtsternberg on github.
  • I am jtsternberg (https://keybase.io/jtsternberg) on keybase.
  • I have a public key whose fingerprint is C858 7FFA 6DFB 4D8E D9B9 9B58 03DF CABB 5678 3A24

To claim this, I am signing this object:

{
"alignment_chars":
[
"=",
":"
],
"alignment_space_chars":
[
"=",
":"
[user]
name = Justin Sternberg
email = justin@dsgnwrks.pro
[github]
user = jtsternberg
token = e6dd738efd04c41f48878e6f82f24d51
; Custom
[alias]
; List all aliases
@jtsternberg
jtsternberg / appp_remove_hook.php
Created April 29, 2014 21:29
Remove AppTheme hooks
<?php
add_action( 'after_setup_theme', 'appp_child_after_setup_theme' );
function appp_child_after_setup_theme() {
// Be sure to match the priority of the original hook
appp_remove_hook( 'appp_left_panel_before', 'left_panel_search', 20 );
}
@jtsternberg
jtsternberg / trisha-import-images.php
Created May 8, 2014 18:08
Handles migrating images to local database/file-system
<?php
/*
Plugin Name: Fix Image Paths
Plugin URI: http://webdevstudios.com
Description: Plugin used to fix images that did not import properly in the MigrationService Plugin.
Author: WebDevStudios
Author URI: http://webdevstudios.com
Version: 1.0.0
License: GPLv2
*/
@jtsternberg
jtsternberg / dsgnwrks-delete-trans.php
Created June 7, 2014 02:52
Adds a query arg link menu item to clear transients when they have a 'delete-trans' backdoor.
<?php
/*
Plugin Name: DsgnWrks Delete Transients Admin Bar Link
Plugin URI: http://dsgnwrks.pro
Description: deletes transients set up with a back-door
Author URI: http://dsgnwrks.pro
Author: DsgnWrks
Donate link: http://dsgnwrks.pro/give/
Version: 1.0
*/
@jtsternberg
jtsternberg / multisite-info.php
Last active August 29, 2015 14:02
Get and display multisite info
<?php
function wds_ms_multisite_directory() {
$sites_info = wds_ms_multisite_info();
foreach ( (array) $sites_info as $site_id => $site_info ) { ?>
<h3><a href="<?php echo esc_url( $site_info['url'] ); ?>"><?php echo esc_html( $site_info['name'] ); ?></a></h3>
<?php echo wpautop( esc_html( $site_info['name'] ) ); ?>
<ul>
<li><a href="<?php echo esc_url( $site_info['rss'] ); ?>"><?php _e( 'RSS for Posts', 'replace-with-correct' ); ?></a></li>