Skip to content

Instantly share code, notes, and snippets.

@mihadaiko
Created Jun 13, 2016
Embed
What would you like to do?
<?php
$m_slider_sort = get_option('sort'); if(empty($c_slider_sort)) {$c_slider_sort = "post_date";}
$m_slider_order = get_option('order'); if(empty($c_slider_order)){$c_slider_order = "DESC";}
$m_slider_post_limit = get_option('limit_posts'); if(empty($m_slider_limit_posts)){$m_slider_limit_posts = "-1";}
global $wpdb;
global $post;
$args = array( 'meta_key' => 'feat_music', 'meta_value'=> '1', 'suppress_filters' => 0, 'post_type' => array('post', 'page'), 'orderby' => $m_slider_sort, 'order' => $m_slider_order, 'numberposts'=> $m_slider_post_limit);
$myposts = get_posts( $args );
$i=0;
foreach( $myposts as $post ) : setup_postdata($post);
$i++;
if ($i=1) {
echo '<div class="first-post>';
{ do your thing for the first post }
echo '</div>';
else { ... }
}
$m_slider_custom = get_post_custom($post->ID);
$m_slider_thumb = m_slider_get_thumb("featmusic");
?>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment