Advertisement
Guest User

featured posts

a guest
Mar 13th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <ul class="double-cloumn clearfix">
  4. <li id="left-column">
  5.  
  6. <!-- gallery slideshow -->
  7. <?php echo do_shortcode('[doptg id="1"]'); ?>
  8. <!-- end gallery slide -->
  9.  
  10. <!-- opening featured posts -->
  11. <?php
  12. $tags = wp_get_post_tags($post->ID);
  13. if ($tags) {
  14. $tag_ids = array();
  15. foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
  16.  
  17. $args=array(
  18. 'tag__in' => $tag_ids,
  19. 'post__not_in' => array($post->ID),
  20. 'showposts'=>4, // Number of related posts that will be shown.
  21. 'caller_get_posts'=>1
  22. );
  23.  
  24. $my_query = new wp_query($args);
  25. if( $my_query->have_posts() ) {
  26. echo '<div id="relatedposts"><h3>Featured Posts</h3><ul>';
  27. while ($my_query->have_posts()) {
  28. $my_query->the_post();
  29. ?>
  30.  
  31. <?php
  32. if ( has_post_thumbnail() ) { ?>
  33. <li><div class="relatedthumb"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail(); ?><?php the_title(); ?></a></div></li>
  34. <?php } else { ?>
  35. <li><div class="relatedthumb"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><img src="<?php echo get_post_meta($post->ID, 'Image',true) ?>" width="196" height="110" alt="<?php the_title_attribute(); ?>" /><?php the_title(); ?></a></div></li>
  36. <?php }
  37. ?>
  38.  
  39. <?php
  40. }
  41. echo '</ul>';
  42. }
  43. }
  44. $post = $backup;
  45. wp_reset_query();
  46. ?>
  47. <!-- closing featured posts -->
  48.  
  49. <ul class="blog-main-post-container">
  50. <?php if (have_posts()) :
  51. global $show_author;
  52. $show_author = 1;
  53. while (have_posts()) : the_post(); setup_postdata($post);
  54. include(TEMPLATEPATH."/functions/fetch-list.php");
  55. endwhile;
  56. else :
  57. ocmx_no_posts();
  58. endif; ?>
  59. </ul>
  60. <?php motionpic_pagination("clearfix", "pagination clearfix"); ?>
  61. </li>
  62. <?php get_sidebar(); ?>
  63. </ul>
  64. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement