Advertisement
nlozovan

Untitled

Mar 11th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.47 KB | None | 0 0
  1. <?php get_header(); ?>
  2. <section id="main">
  3.  
  4.  
  5. <?php
  6. $position = '';
  7. $repeat = '';
  8. $bgatt = '';
  9. $background_img = '';
  10. $background_color = '';
  11.  
  12. if( is_single() || is_page() ){
  13. $settings = meta::get_meta( $post -> ID , 'settings' );
  14. if( ( isset( $settings['post_bg'] ) && !empty( $settings['post_bg'] ) ) || ( isset( $settings['color'] ) && !empty( $settings['color'] ) ) ){
  15. if( isset( $settings['post_bg'] ) && !empty( $settings['post_bg'] ) ){
  16. $background_img = "background-image: url('" . $settings['post_bg'] . "');";
  17. }
  18.  
  19. if( isset( $settings['color'] ) && !empty( $settings['color'] ) ){
  20. $background_color = "background-color: " . $settings['color'] . "; ";
  21. }
  22.  
  23. if( isset( $settings['position'] ) && !empty( $settings['position'] ) ){
  24. $position = 'background-position: '. $settings['position'] . ';';
  25. }
  26. if( isset( $settings['repeat'] ) && !empty( $settings['repeat'] ) ){
  27. $repeat = 'background-repeat: '. $settings['repeat'] . ';';
  28. }
  29. if( isset( $settings['attachment'] ) && !empty( $settings['attachment'] ) ){
  30. $bgatt = 'background-attachment: '. $settings['attachment'] . ';';
  31. }
  32. }else{
  33. if(get_background_image() == ''){
  34.  
  35. $background_img = '';
  36.  
  37. }else{
  38. $background_img = get_background_image();
  39. }
  40.  
  41. }
  42. }else{
  43. if(get_background_image() == '' ){
  44. $background_img = '';
  45. }else{
  46. $background_img = get_background_image();
  47. }
  48.  
  49. }
  50. ?>
  51.  
  52.  
  53. <?php
  54. while( have_posts () ){
  55. the_post();
  56. $post_id = $post -> ID;
  57.  
  58. $template = 'single';
  59. $size = 'tsingle_style';
  60.  
  61. $s = image::asize( image::size( $post->ID , $template , $size ) );
  62.  
  63. $zoom = false;
  64.  
  65. if( options::logic( 'blog_post' , 'enb_featured' ) ){
  66. if ( has_post_thumbnail( $post -> ID ) && get_post_format( $post -> ID ) != 'video' ) {
  67. $src = image::thumbnail( $post -> ID , $template , $size );
  68. $src_ = image::thumbnail( $post -> ID , $template , 'full' );
  69. $caption = image::caption( $post -> ID );
  70. $zoom = true;
  71. }
  72. }
  73. ?>
  74.  
  75.  
  76.  
  77.  
  78. <div id="primary" >
  79. <div id="content" role="main">
  80. <?php
  81. get_ads('logo');
  82. ?>
  83.  
  84. <?php
  85. if( get_post_format($post->ID)=="gallery" ){
  86. /* for gallery posts we will show a slidedhow if there are more than 1 images */
  87. ob_start();
  88. ob_clean();
  89. post::get_post_img_slideshow( $post -> ID, $size = 'tsingle_gallery', $background_color, $background_img , $position, $repeat, $bgatt );
  90. $single_slideshow = ob_get_clean();
  91. }
  92.  
  93. if(isset($single_slideshow) && strlen($single_slideshow)){
  94. echo '<div class="header-collapser icon-top animated"></div>';
  95. ?> <div class="row">
  96.  
  97. <div class="twelve columns">
  98.  
  99. <h2 class="post-title" style="padding-top: 25px;">
  100. <?php
  101.  
  102. the_title();
  103. ?>
  104. </h2>
  105.  
  106.  
  107.  
  108. </div>
  109. </div><?php
  110. echo $single_slideshow;
  111. }else{ /*we show featured image only when */
  112.  
  113. if( options::logic( 'blog_post' , 'enb_featured' ) ){
  114. if ( has_post_thumbnail( $post -> ID ) && get_post_format( $post -> ID ) != 'video' ) {
  115. $src = image::thumbnail( $post -> ID , $template , $size );
  116. $full_img_url = image::thumbnail( $post -> ID , $template , 'full' );
  117. $caption = image::caption( $post -> ID );
  118. ?>
  119. <div class="entry-header" style="<?php echo $background_color ; ?> <?php echo $background_img ; ?> <?php echo $position; ?> <?php echo $repeat; ?> <?php echo $bgatt; ?>">
  120. <div class="row">
  121.  
  122. <div class="twelve columns">
  123.  
  124. <h2 class="post-title" style="padding-top: 25px;">
  125. <?php
  126.  
  127. the_title();
  128. ?>
  129. </h2>
  130.  
  131.  
  132.  
  133. </div>
  134. </div>
  135.  
  136. <div class="featimg">
  137. <?php
  138. echo '<img src="' . $src[0] . '" alt="' . $caption . '" >';
  139. ?>
  140. <?php if( options::logic( 'blog_post' , 'enb_lightbox' )){ ?>
  141. <div class="zoom-image">
  142. <a href="<?php echo $full_img_url[0]; ?>" rel="prettyPhoto" title="">&nbsp;</a>
  143. </div>
  144. <?php } ?>
  145. <?php if (options::logic('styling', 'stripes')) { ?>
  146. <div class="stripes">&nbsp;</div><!--Must put height equal to image-->
  147. <?php } ?>
  148. </div>
  149. </div>
  150. <?php
  151. }
  152. }
  153. }
  154.  
  155. $paralax = post::get_paralax_settings($post);
  156. if(is_array($paralax)){
  157. $paralax_enb_class = 'has-paralax';
  158. $paralax_pattern = $paralax['pattern'];
  159. $paralax_image = $paralax['image'];
  160. $paralax_enb = true;
  161. }else{
  162. $paralax_enb_class = '';
  163. $paralax_enb = false;
  164. }
  165. ?>
  166. <div class="single-row-container <?php echo $paralax_enb_class; ?>">
  167. <?php if($paralax_enb){ ?>
  168. <div class="single-slide-effects">
  169. <div class="single-slide1 single-slide-<?php echo $paralax_pattern; ?>"></div>
  170. <div class="single-slide2 single-slide-<?php echo $paralax_image; ?>"></div>
  171. </div>
  172. <?php } ?>
  173. <div class="single-main">
  174. <div class="row">
  175. <nav class="hotkeys-meta">
  176. <span class="nav-previous"><?php previous_post_link( '%link' , __('', 'cosmotheme') ); ?></span>
  177. <span class="nav-next"><?php next_post_link( '%link' , __('', 'cosmotheme') ); ?></span>
  178. </nav>
  179. <?php if( options::logic( 'blog_post' , 'breadcrumbs' ) ){ ?>
  180. <div class="twelve columns breadcrumbs">
  181. <?php echo dimox_breadcrumbs();?>
  182. </div>
  183. <?php } ?>
  184. <?php layout::side( 'left' , $post_id , 'single'); ?>
  185.  
  186. <div class="main-container <?php echo tools::primary_class( $post_id , 'single', $return_just_class = true ); ?>">
  187. <article id="post-<?php the_ID(); ?>" <?php post_class( 'post big-post single-post no_bg' , $post -> ID ); ?>>
  188.  
  189.  
  190.  
  191. <div class="entry-content ">
  192. <div class="row">
  193.  
  194.  
  195. <?php
  196. if( meta::logic( $post , 'settings' , 'meta' ) ){
  197. post::meta( $post );
  198. $content_nr_columns = 'nine';
  199. }else{
  200. $content_nr_columns = 'twelve';
  201. }
  202. ?>
  203.  
  204. <div class="<?php echo $content_nr_columns; ?> columns">
  205. <?php
  206.  
  207. //-------------------------
  208. if( get_post_format( $post -> ID ) == 'video' ){
  209.  
  210. $video_format = meta::get_meta( $post -> ID , 'format' );
  211. ?>
  212.  
  213. <div class="embedded_videos">
  214. <?php
  215.  
  216. $format=$video_format;
  217. if( isset( $format['video'] ) && !empty( $format['video'] ) && post::isValidURL( $format['video'] ) ){
  218. $vimeo_id = post::get_vimeo_video_id( $format['video'] );
  219. $youtube_id = post::get_youtube_video_id( $format['video'] );
  220. $video_type = '';
  221. if( $vimeo_id != '0' ){
  222. $video_type = 'vimeo';
  223. $video_id = $vimeo_id;
  224. }
  225.  
  226. if( $youtube_id != '0' ){
  227. $video_type = 'youtube';
  228. $video_id = $youtube_id;
  229. }
  230.  
  231. if( !empty( $video_type ) ){
  232. echo post::get_embeded_video( $video_id , $video_type );
  233. }
  234.  
  235. }else if( isset( $video_format["feat_url"] ) && strlen($video_format["feat_url"])>1){
  236.  
  237. $video_url=$video_format["feat_url"];
  238. if(post::get_youtube_video_id($video_url)!="0")
  239. {
  240. echo post::get_embeded_video(post::get_youtube_video_id($video_url),"youtube");
  241. }
  242. else if(post::get_vimeo_video_id($video_url)!="0")
  243. {
  244. echo post::get_embeded_video(post::get_vimeo_video_id($video_url),"vimeo");
  245. }
  246. }else if(isset( $video_format["feat_id"] ) && strlen($video_format["feat_id"])>1){
  247. echo do_shortcode('[video mp4="'.wp_get_attachment_url($video_format["feat_id"]).'" width="610" height="443"]');
  248. //echo post::get_local_video( urlencode(wp_get_attachment_url($video_format["feat_id"])));
  249. }
  250. ?>
  251.  
  252. <?php
  253.  
  254. if(isset($video_format['video_ids']) && !empty($video_format['video_ids'])){
  255. foreach($video_format["video_ids"] as $videoid)
  256. {
  257. if( isset( $video_format[ 'video_urls' ][ $videoid ] ) ){
  258. $video_url = $video_format[ 'video_urls' ][ $videoid ];
  259. if( post::get_youtube_video_id($video_url) != "0" ){
  260. echo post::get_embeded_video( post::get_youtube_video_id( $video_url ), "youtube" );
  261. }else if( post::get_vimeo_video_id( $video_url ) != "0" ){
  262. echo post::get_embeded_video( post::get_vimeo_video_id( $video_url ) , "vimeo" );
  263. }
  264. }
  265. else echo post::get_local_video( urlencode(wp_get_attachment_url($videoid)));
  266. }
  267. }
  268. ?>
  269. </div>
  270. <?php
  271. }
  272.  
  273. //---------------------------
  274. if(get_post_format($post->ID)=="image")
  275. {
  276. $image_format = meta::get_meta( $post -> ID , 'format' );
  277. echo "<div class=\"attached-image-gallery\">";
  278. echo '<div class="row">';
  279. if(isset($image_format['images']) && is_array($image_format['images']))
  280. {
  281. foreach($image_format['images'] as $index=>$img_id)
  282. {
  283. $thumbnail= wp_get_attachment_image_src( $img_id, 'thumbnail');
  284. $full_image=wp_get_attachment_url($img_id);
  285. $url=$thumbnail[0];
  286. $width=$thumbnail[1];
  287. $height=$thumbnail[2];
  288. echo '<div class="three columns mobile-one">';
  289. echo "<div class=\"attached-image-gallery-elem\">";
  290. echo "<a title=\"\" rel=\"prettyPhoto[".get_the_ID()."]\" href=\"".$full_image."\">";
  291.  
  292. if($height<150)
  293. {
  294. $vertical_align_style="style=\"margin-top:".((150-$height)/2)."px;\"";
  295. }
  296. else
  297. {
  298. $vertical_align_style="";
  299. }
  300.  
  301. echo "<img alt=\"\" src=\"$url\" $vertical_align_style>";
  302. echo "</a>";
  303. echo "</div>";
  304. echo "</div>";
  305. }
  306.  
  307. }
  308. echo "</div>";
  309. echo "</div>";
  310. }
  311.  
  312. if( get_post_format( $post -> ID ) == 'audio' ){
  313. $audio = new AudioPlayer();
  314. echo $audio->processContent( post::get_audio_file( $post -> ID ) );
  315. }
  316. the_content();
  317.  
  318. ?>
  319. <?php
  320. if( get_post_format( $post -> ID ) == 'link' ){
  321. echo post::get_attached_file( $post -> ID );
  322. }
  323.  
  324. ?>
  325. <div class="clear"></div>
  326. <?php wp_link_pages(array('before' => '<div class="pagenumbers"><p>Pages:','after' => '</p></div> ', 'next_or_number' => 'number')); ?>
  327. <?php get_template_part('social-sharing'); ?>
  328. </div>
  329. </div>
  330.  
  331. </div>
  332. </article>
  333. </div>
  334.  
  335. <?php layout::side( 'right' , $post_id , 'single' ); ?>
  336. </div>
  337. </div>
  338. </div>
  339. <?php
  340. /* related posts */
  341. get_template_part( 'related-posts' );
  342. ?>
  343. <?php
  344. /* comments */
  345. if( comments_open() ){
  346. ?>
  347. <div class="single-row-container">
  348.  
  349. <div class="row">
  350. <div class="cosmo-comments twelve columns">
  351. <?php
  352. if( options::logic( 'blog_post' , 'fb_comments' ) ){
  353. ?>
  354. <div id="comments">
  355. <div class="row">
  356. <h3 id="reply-title"><?php _e( 'Leave a reply' , 'cosmotheme' ); ?></h3>
  357. <div class="twelve columns">
  358. <p class="delimiter">&nbsp;</p>
  359. <fb:comments href="<?php the_permalink(); ?>" num_posts="5" width="430" height="120" reverse="true"></fb:comments>
  360. </div>
  361. </div>
  362. </div>
  363. <?php
  364. }else{
  365. comments_template( '', true );
  366. }
  367. ?>
  368. </div> <!-- eof cosmo comments -->
  369.  
  370. </div>
  371.  
  372. </div>
  373.  
  374. <?php
  375. }
  376. ?>
  377. </div>
  378.  
  379.  
  380.  
  381. <?php
  382. get_ads('content');
  383. ?>
  384.  
  385. </div>
  386.  
  387.  
  388. <?php
  389. }
  390. ?>
  391.  
  392.  
  393. </section>
  394. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement