1. <?php
  2. /**
  3. * The default template for displaying content
  4. *
  5. * Used for both single and index/archive/search.
  6. *
  7. * @package WordPress
  8. * @subpackage Twenty_Thirteen
  9. * @since Twenty Thirteen 1.0
  10. */
  11. ?>
  12. <?php if ( is_single() ) : ?>
  13. <div id="main_container" class="container clearfix">
  14. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  15. <div style="clear: both;"></div>
  16. <div class="block-left">
  17. <?php if(has_post_thumbnail()) :
  18. the_post_thumbnail( 'full' );
  19. else : ?>
  20. <img class="attachment-full wp-post-image" src="<?php bloginfo('template_url'); ?>/images/sample450.jpg" />
  21. <?php endif; ?><span class="watermark-logo"></span>
  22. <h2 class="single-post-external">
  23. <?php if(get_field( "nofollow_tag" )) { $nofollow_tag = 'rel="nofollow"'; }
  24. else { $nofollow_tag = ''; } ?>
  25. <?php echo $post_external_link = (get_post_meta(get_the_ID(),'post_external_link',true))?'<a href="'.get_post_meta(get_the_ID(),'post_external_link',true).'" '.$nofollow_tag.'>Click here to visit website</a>':'#'; ?>
  26. </h2>
  27. </div>
  28. <div class="block-right">
  29. <h2 class="single-post-title"><?php the_title(); ?></h2>
  30. <div class="mr-single-postrating"><?php if(function_exists("kk_star_ratings")) : echo kk_star_ratings(get_the_ID()); endif; ?></div>
  31. <div class="clearfix"></div>
  32. <h4 class="single-post-reveiws"><?php echo $post_external_link = (get_post_meta(get_the_ID(),'post_external_link',true))?'<a href="'.get_post_meta(get_the_ID(),'post_external_link',true).'" '.$nofollow_tag.'>'.get_post_meta($post->ID, 'domaintag', true).'</a>':'<a href="'.get_post_meta(get_the_ID(),'post_external_link',true).'" '.$nofollow_tag.'>'.get_post_meta(get_the_ID(),'post_external_link',true).'</a>'; ?></h4>
  33. <div class="single-post-content"><?php the_content(); ?></div>
  34. <div class="likesNd-hates-out">
  35. <?php the_field("likes_hates_section"); ?>
  36. </div>
  37. </div>
  38. <div style="clear: both;"></div>
  39. </article><!-- #post -->
  40. </div>
  41. <?php else : ?>
  42. <?php if ( !is_search() ) : // Only display Excerpts for Search?>
  43. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  44. <div class="col-md-3 col-sm-3 col-xs-3">
  45. <?php
  46. $post_external_link = (get_post_meta(get_the_ID(),'post_external_link',true))?get_post_meta(get_the_ID(),'post_external_link',true):'#';
  47. $new_post_added = (get_post_meta(get_the_ID(),'new_post_added',true))?'<span class="new_txt">'.get_post_meta(get_the_ID(),'new_post_added',true).'</span>':'';
  48. ?>
  49. <div class="trip-box">
  50. <a title="<?php the_title(); ?>" target="_blank" href="<?php echo $post_external_link; ?>"><span class="li_list"><?php the_title(); ?></span><?php echo $new_post_added; ?></a>
  51. <a title="Click to visit <?php the_title(); ?>" href="<?php the_permalink(); ?>"><span class="review"></span></a>
  52. <a title="<?php the_title(); ?>" target="_blank" href="<?php echo $post_external_link; ?>">
  53. <?php /*?><img style="height:auto;width:100%;" class="lazyLoad" data-src="<?php bloginfo('template_url'); ?>/images/sample450.jpg" src="<?php bloginfo('template_url'); ?>/images/loading.gif" /><?php */?>
  54. <?php
  55. if(has_post_thumbnail())
  56. {
  57. $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'full' );
  58. echo '<img class="attachment-full lazyLoad wp-post-image" data-src="'.$thumb[0].'" src="'.get_template_directory_uri().'/images/placeholder-img.png"/>';
  59. } else {
  60. echo '<img class="attachment-full lazyLoad wp-post-image" data-src="'.get_template_directory_uri().'/images/sample450.jpg" src="'.bloginfo('template_url').'/images/placeholder-img.png" />';
  61. }
  62. ?>
  63. </a>
  64. </div>
  65. </div>
  66. </article><!-- #post -->
  67. <?php endif; // is_search() ?>
  68. <?php endif; // is_single() ?>
  69. <?php if ( is_search() ) : // Only display Excerpts for Search ?>
  70. <div id="main_container" class="container clearfix">
  71. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  72. <div style="clear: both;">
  73. <div class="block-left-search">
  74. <?php if(has_post_thumbnail()) :
  75. the_post_thumbnail( 'full' );
  76. else : ?>
  77. <img class="attachment-full wp-post-image" src="<?php bloginfo('template_url'); ?>/images/sample450.jpg" />
  78. <?php endif; ?>
  79. </div>
  80. <div class="block-right-search">
  81. <h2 class="single-post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  82. <p class="single-post-external">
  83. <?php echo $post_external_link = (get_post_meta(get_the_ID(),'post_external_link',true))?'<a href="'.get_post_meta(get_the_ID(),'post_external_link',true).'" '.$nofollow_tag.'>Click here to visit website</a>':'#'; ?>
  84. </p>
  85. <h4 class="single-post-reveiws">
  86. <?php if ( ! dynamic_sidebar( 'Review Widget' ) ) : ?>
  87. <?php endif ?>
  88. </h4>
  89. <div class="single-post-content"><?php the_excerpt(); ?></div>
  90. </div>
  91. </div>
  92. </article><!-- #post -->
  93. </div>
  94. <?php endif; ?>