Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $marquee_loop = new WP_Query(
- array(
- 'post_type' => 'marquee_panel',
- 'posts_per_page' => 10,
- 'post_status' => 'publish'
- )
- );
- while ( $marquee_loop -> have_posts() ) : $marquee_loop -> the_post();
- the_title('<h3>','</h3>');
- endwhile;
- //--------------------------------------------------------------------------------------------------------------
- echo '<div class="marquee">';
- echo '<div class="marquee_data">';
- while ( $marquee_loop -> have_posts() ) : $marquee_loop -> the_post();
- $image_id = get_post_thumbnail_id( $post_id );
- $image_url_full = wp_get_attachment_image_src($image_id,'full');
- $image_url_large = wp_get_attachment_image_src($image_id,'large');
- echo '<div class="marquee_panel" data-image-full="'.$image_url_full[0].'" data-image-large="'.$image_url_large[0].'">';
- echo '<div class="panel_caption">';
- the_title('<h3>','</h3>');
- echo '<div class="panel_content">';
- the_content();
- echo '</div>';
- echo '</div>';
- echo '</div>';
- endwhile;
- echo '</div>';
- echo '</div>';
- //-----------------------------------------------------------------------------------------------------------------
- <!-- Markup of the above code -->
- <div class="marquee">
- <div class="marquee_data">
- <div class="marquee_panel"
- data-image-full="http://full-image-url.jpg"
- data-image-large="http://large-image-url.jpg">
- <div class="panel_caption">
- <h3>this is title</h3>
- <div class="panel_content">
- <p>this is content</p>
- <a href="#"></a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- These are HTML5 attributes
- data-image-full=""
- data-image-large=""
- -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement