Skip to content

Instantly share code, notes, and snippets.

add_rewrite_rule(
'^time/',
'index.php',
'top'
);
/**
* Append "Menu" to newly created menus so they slugs dont screw up other taxonomy slugs
*/
function time_nav_menu_filter() {
if( isset( $_POST['menu-name'] ) )
$_POST['menu-name'] .= ' Menu';
}
add_action( 'admin_init', 'time_nav_menu_filter' );
function omni_myTemplateLoaded(experienceID) {
player = brightcove.api.getExperience(experienceID);
modVP = player.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER);
modExp = player.getModule(brightcove.api.modules.APIModules.EXPERIENCE);
modCon = player.getModule(brightcove.api.modules.APIModules.CONTENT);
modAd = player.getModule(brightcove.api.modules.APIModules.ADVERTISING); /* Add advertising module for comScore ad tracking */
modExp.addEventListener(brightcove.api.events.ExperienceEvent.TEMPLATE_READY, onTemplateReady);
}
register_taxonomy( 'time_section', array( 'post', 'time_sponsored_post', 'time_collection' ), array(
'hierarchical' => false,
'labels' => $section_labels,
'capabilities' => array(
'manage_terms' => 'manage_sections',
'edit_terms' => 'manage_sections',
'delete_terms' => 'manage_sections',
'assign_terms' => 'edit_posts'
),
'rewrite' => array(
@micahwave
micahwave / gist:7848034
Created December 7, 2013 20:14
Fix featured images
/**
*
*/
function fix_featured_images() {
// only do 10 at a time
$posts = get_posts( array(
'posts_per_page' => 10,
'post_status' => 'publish',
'meta_query' => array(
/**
* API Resources
*/
/*
* Right Now
*
* http://time.com/api/right-now/
* http://time.com/api/right-now/tech/
*/
@micahwave
micahwave / gist:5885641
Created June 28, 2013 15:41
vip reblog
<style>
/* <![CDATA[ */
/* Block: reblog */
.reblog-from img { margin: 0 10px 0 0; vertical-align: middle; padding: 0; border: 0; }
.reblogger-note img.avatar { float: left; padding: 0; border: 0; }
.reblogger-note-content { margin: 0 0 20px; }
.reblog-post .wpcom-enhanced-excerpt-content { border-left: 3px solid #eee; padding-left: 15px; }
.reblog-post ul.thumb-list { display: block; list-style: none; margin: 2px 0; padding: 0; clear: both; }
.reblog-post ul.thumb-list li { display: inline; margin: 0; padding: 0 1px; border: 0; }
<?php
// somewhere in single.php
if( time_is_paid_content() ) {
if( time_is_paid_user() ) {
the_content();
} else {
echo 'Sorry, you must log in or sign up to view this content.'
}
@micahwave
micahwave / gist:5302094
Created April 3, 2013 15:14
How NOT to do responsive
@media screen and (max-width: 1122px) {
.full-col {
width: 1081px;
}
}
@media screen and (max-width: 1115px) {
.full-col {
width: 1084px;
}
<!--[if lt IE 9]>
<link rel="stylesheet" href="http://entertainment.time.com/wp-content/themes/vip/time2012/library/assets/css/style.css" media="all"/>
<script src="http://entertainment.time.com/wp-content/themes/vip/time2012/library/assets/js/libs/respond/respond.min.js"></script>
<![endif]-->
<!--[if gt IE 8]><!--><link rel="stylesheet" href="http://s0.wp.com/wp-content/themes/vip/time2012/library/assets/css/style.css?m=1363875156g" media="all"/><!--<![endif]-->