Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php query_posts('post_type=ads&posts_per_page=4&tag=home-above&orderby=rand'); ?>
- <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
- <?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail($post->ID) ) {
- $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full ); ?>
- <img class="has-tip tip-top" data-width="210" title="<?php the_field('hover_text'); ?>" src="<?php echo $thumbnail[0]; ?>" />
- <?php }else{ ?>
- <img src="/DetroitSounds/wp-content/uploads/2013/01/youradhere.jpg" />
- <?php } ?>
- <?php endwhile; ?>
- <?php endif; wp_reset_query();?>
- $args = array( 'post_type' => 'ads',
- 'tax_query' => array(
- array(
- 'taxonomy' => 'taxonomy_name_will_comes_here',
- 'field' => 'slug',
- 'terms' => 'category_name_will_comes_here'
- )
- )
- );
- $loop = new WP_Query( $args );
- while ( $loop->have_posts() ) : $loop->the_post();
- the_title();
- echo '<div class="entry-content">';
- the_content();
- echo '</div>';
- endwhile;
- <?php query_posts('post_type=ads&posts_per_page=4&category_name=home-page-above&orderby=rand'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement