get_header(); do_action('sp_start_content_wrap_html'); ?> <div id="main" class="main"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php echo sp_post_type_sub_nav('room'); ?> <?php echo sp_sliders(1, $post->ID, 'post-slider'); ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <header class="entry-header"> <h1 class="entry-title"><?php the_title(); ?> </h1> </header>
function sp_slider_sc($atts, $content = null) { extract(shortcode_atts(array('slide_id' => null, 'slide_num' => null), $atts)); $out = ''; $args = array('post_type' => 'slider', 'posts_per_page' => $slide_num, 'p' => $slide_id); $custom_query = new WP_Query($args); while ($custom_query->have_posts()) { $custom_query->the_post(); $out .= sp_sliders(1, $slide_id, 'post-slider'); } wp_reset_postdata(); // Restore global post data return $out; }