This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$q = new WP_Query( | |
array( | |
'posts_per_page' => -1, | |
'post__not_in' => array( 1368 ), // skipping http://newsfeed.time.com/2010/05/17/taste-testing-the-worlds-most-alcoholic-beer/ | |
'post_status' => 'publish', | |
'post_type' => 'post', | |
'author' => 14074318, | |
) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Cron to process all of the posts that don't have bitly urls | |
*/ | |
function time_process_bitly() { | |
global $wpdb; | |
// get 100 published posts that don't have a bitly url | |
$query = $wpdb->prepare( | |
" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<media-reference id="media-reference:b1ae49b273d2e307090f6a70670057e5" mime-type="image/jpeg" name="AP Thumbnail Image" source="http://eapcontent.ap.org/jpg/2012/20120314/11/b1ae49b273d2e307090f6a70670057e5.jpg?contentid=b1ae49b273d2e307090f6a70670057e5/fmt=jpg/role=Thumbnail/reldt=2012-03-14T11:05:58/media=Photo/recordid=5ba9fcac175943c58a2915a3ca65020b/authToken=eNoFwrEKwzAMBcAvsnmyLakeNHbI0K3QsdiJAtkMoSSDP77cTb9NchHlykACQPSguR7WqXmpPQXNWwqeoQEVe5CmEAVYnefvtPfyei7fj%2ffdfTvnuKwNIpnHsEQSM0ctsfwBxaUc9Q%3d%3d&token=1331998202_46B3C20C9EE3641CADC69F406362AAD9" alternate-text="John Bishop" height="83" width="128" coding="jpg" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper function to get the short url for a post | |
* | |
* @param int $post_id | |
* @return string $url | |
*/ | |
function time_get_bitly_url( $post_id = null ) { | |
$post_id = empty( $post_id ) ? get_the_ID() : $post_id; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function time_first_post() { | |
global $wp_query; | |
return ( in_the_loop() && $wp_query->current_post == 0 ); | |
} | |
function time_last_post() { | |
global $wp_query; | |
return ( in_the_loop() && $wp_query->current_post == $wp_query->post_count-1 ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// backend, gather the data | |
if( have_posts() ) { | |
get_template_part( 'derp' ); | |
} | |
wp_reset_query(); | |
// front-end, derp.php | |
<?php while( have_posts() ) : the_post(); ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function migrate_old_package( $post_id ) { | |
global $wpdb; | |
// fix all the slides | |
$slides = $wpdb->get_results( $wpdb->prepare(" | |
SELECT * FROM $wpdb->posts AS s WHERE s.post_type = 'time_slide' AND s.post_parent = $post_id | |
")); | |
foreach( $slides as $slide ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<article id="article-<?php the_ID(); ?>" <?php post_class(); ?>> | |
<header class="entry-header"> | |
<h3 class="entry-category">Category</h3> | |
<h1 class="entry-title">Article Title</h1> | |
<div class="entry-meta"> | |
<span class="entry-byline">By Author</span> | |
<span class="entry-data">Date</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ol class="wp-paginate"> | |
<li><span class="title"></span></li> | |
<li><span class="page current">1</span></li> | |
<li><a href="http://micahland.com/page/2/" title="2" class="page">2</a></li> | |
<li><a href="http://micahland.com/page/3/" title="3" class="page">3</a></li> | |
<li><a href="http://micahland.com/page/4/" title="4" class="page">4</a></li> | |
<li><a href="http://micahland.com/page/5/" title="5" class="page">5</a></li> | |
<li><span class="gap">...</span></li> | |
<li><a href="http://micahland.com/page/8/" title="8" class="page">8</a></li> | |
<li><a href="http://micahland.com/page/2/" class="next">Next</a></li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="time-gallery package"> | |
<div class="nav"> | |
<a href="#" class="disabled arrow prev">prev</a> | |
<div style="float:left"> | |
<div class="count" style="float:none;"> | |
<span class="position">1</span> |