Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <?php query_posts('post_type=ads&posts_per_page=4&tag=home-above&orderby=rand'); ?>
  2. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  3.  
  4.  
  5.  
  6. <?php if ( function_exists('has_post_thumbnail') && has_post_thumbnail($post->ID) ) {
  7. $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full ); ?>
  8. <img class="has-tip tip-top" data-width="210" title="<?php the_field('hover_text'); ?>" src="<?php echo $thumbnail[0]; ?>" />
  9.  
  10. <?php }else{ ?>
  11. <img src="/DetroitSounds/wp-content/uploads/2013/01/youradhere.jpg" />
  12. <?php } ?>
  13.  
  14.  
  15.  
  16. <?php endwhile; ?>
  17.  
  18. <?php endif; wp_reset_query();?>
  19.  
  20. $args = array( 'post_type' => 'ads',
  21. 'tax_query' => array(
  22. array(
  23. 'taxonomy' => 'taxonomy_name_will_comes_here',
  24. 'field' => 'slug',
  25. 'terms' => 'category_name_will_comes_here'
  26. )
  27. )
  28. );
  29. $loop = new WP_Query( $args );
  30. while ( $loop->have_posts() ) : $loop->the_post();
  31. the_title();
  32. echo '<div class="entry-content">';
  33. the_content();
  34. echo '</div>';
  35. endwhile;
  36.  
  37. <?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