Skip to content

Instantly share code, notes, and snippets.

function flexslider_scripts()
{
wp_register_script( 'flexslider', get_stylesheet_directory_uri() . '/js/jquery.flexslider.js', array( 'jquery' ) );
wp_enqueue_script( 'flexslider' );
}
add_action( 'wp_enqueue_scripts', 'flexslider_scripts' );
$query = new WP_Query( array(
'post_type' => 'wod',
'posts_per_page' => -1,
) );
if( $query->have_posts() ): while( $query->have_posts() ): $query->the_post();
the_content();
endwhile;
endif;
function order_featured( $query ) {
if ( ! is_admin() && $query->is_main_query() ) {
$query->set(
'orderby' => 'meta_value_num ',
'order' => 'ASC', );
}
}
add_action( 'pre_get_posts', 'order_featured' );
function order_featured( $query ) {
global $terms;
if( $query->is_main_query() && !is_admin() && is_post_type_archive( 'event' ) ) {
$meta_query = array(
array(
'key' => 'featured',
'value' => 'meta_value_num',
)
);
$query->set( 'meta_query', $meta_query );
if( $query->is_main_query() && !is_admin() ) {
$meta_query = array(
array(
'key' => 'featured',
'value' => '1',
)
);
//$query->set( 'meta_query', $meta_query );
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'meta_key', 'featured' );
function order_featured( $query ) {
global $terms;
if( $query->is_main_query() && !is_admin() ) {
$meta_query = array(
array(
'key' => 'featured',
'value' => '1',
)
);
$tweetq= pods('twitter_resources');
$tweetq->find();
while ( $tweetq->fetch() ) :
$fromname = $tweetq->field('from_user');
$categorize = $tweetq->field('categorize');
# Get only recent strings from twitter to avoid pulling dupes
$max_id = get_option('ttp_max_tweet_id', 0);
// Fire the HTTP request to Twitter
$response = wp_remote_get('http://search.twitter.com/search.json?q=from:'. urlencode($fromname) .'&result_type=recent&rpp=10&since_id='.$max_id);
$tweetq= pods('twitter_resources');
$tweetq->find();
while ( $tweetq->fetch() ) :
$fromname = $tweetq->field('from_user');
# $hashtag = $tweetq->field('hash_tag'); not needed anymore
$categorize = $tweetq->field('categorize');
# Get only recent strings from twitter to avoid pulling dupes
$max_id = get_option('ttp_max_tweet_id', 0);
// Fire the HTTP request to Twitter
$tweetq= pods('twitter_resources');
$tweetq->find();
$response = array();
#This looks for every pods record and gets fields for each of them and puts them into a url for each record
while ( $tweetq->fetch() ) :
$fromname = $tweetq->field('from_user');
# $hashtag = $tweetq->field('hash_tag'); not needed anymore
$categorize = $tweetq->field('categorize');
# Get only recent strings from twitter to avoid pulling dupes
$max_id = get_option('ttp_max_tweet_id', 0);
array(5) { ["headers"]=> array(15) { ["cache-control"]=> string(40) "max-age=15, must-revalidate, max-age=300" ["expires"]=> string(29) "Wed, 30 Jan 2013 03:07:39 GMT" ["content-type"]=> string(30) "application/json;charset=utf-8" ["x-transaction"]=> string(16) "5b10ca6651bc4669" ["x-frame-options"]=> string(10) "SAMEORIGIN" ["status"]=> string(6) "200 OK" ["vary"]=> string(15) "Accept-Encoding" ["date"]=> string(29) "Wed, 30 Jan 2013 03:02:39 GMT" ["x-varnish"]=> string(9) "478712638" ["age"]=> string(1) "0" ["via"]=> string(11) "1.1 varnish" ["set-cookie"]=> string(103) "k=184.154.69.106.5b10ca6651bc4669; path=/; expires=Wed, 06-Feb-2013 03:02:39 UTC; domain=.com; httponly" ["server"]=> string(3) "tfe" ["content-encoding"]=> string(7) "deflate" ["content-length"]=> string(4) "2163" } ["body"]=> string(8416) "{"completed_in":0.118,"max_id":296453282199650304,"max_id_str":"296453282199650304","next_page":"?page=2&max_id=296453282199650304&q=from%3A&rpp=10&result_type=recent","page":1,"query":"from%3A","refres