Advertisement
JosueCR

template.blog.php

Jun 21st, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4.  
  5. * Template Name: Blog
  6.  
  7. */
  8.  
  9. get_header(); ?>
  10.  
  11.  
  12.  
  13. <div id="content" class="container clearfix">
  14.  
  15.  
  16.  
  17. <!-- page header -->
  18.  
  19. <div class="container clearfix ">
  20.  
  21.  
  22.  
  23.  
  24.  
  25. <?php if(of_get_option('sc_showpageheader') == '1' && get_post_meta($post->ID, 'snbpd_ph_disabled', true)!= 'on' ) : ?>
  26.  
  27.  
  28.  
  29. <?php if(get_post_meta($post->ID, 'snbpd_phitemlink', true)!= '') : ?>
  30.  
  31.  
  32.  
  33. <?php
  34.  
  35.  
  36.  
  37. $thumbId = get_image_id_by_link ( get_post_meta($post->ID, 'snbpd_phitemlink', true) );
  38.  
  39. $thumb = wp_get_attachment_image_src($thumbId, 'page-header', false);
  40.  
  41. ?>
  42.  
  43. <img class="intro-img" alt=" " src="<?php echo $thumb[0] ?>" alt="<?php the_title(); ?>" />
  44.  
  45.  
  46.  
  47. <?php elseif (of_get_option('sc_pageheaderurl') !='' ): ?>
  48.  
  49.  
  50.  
  51. <?php
  52.  
  53. $thumbId = get_image_id_by_link ( of_get_option('sc_pageheaderurl') );
  54.  
  55. $thumb = wp_get_attachment_image_src($thumbId, 'page-header', false);
  56.  
  57. ?>
  58.  
  59. <img class="intro-img" alt=" " src="<?php echo $thumb[0] ?>" alt="<?php the_title(); ?>" />
  60.  
  61.  
  62.  
  63. <?php else: ?>
  64.  
  65.  
  66.  
  67. <img class="intro-img" alt=" " src="<?php echo get_template_directory_uri(); ?>/library/images/inner-page-bg.jpg" />
  68.  
  69.  
  70.  
  71. <?php endif ?>
  72.  
  73. <?php endif ?>
  74.  
  75.  
  76.  
  77. </div>
  78.  
  79.  
  80.  
  81. <!-- content -->
  82.  
  83. <div class="three-fourth">
  84.  
  85.  
  86.  
  87. <h1><?php the_title(); ?> <?php if ( !get_post_meta($post->ID, 'snbpd_pagedesc', true)== '') { ?>/<?php }?> <span><?php echo get_post_meta($post->ID, 'snbpd_pagedesc', true); ?></span></h1>
  88.  
  89.  
  90.  
  91.  
  92.  
  93. <div id="main" role="main">
  94.  
  95.  
  96.  
  97. <?php
  98.  
  99. // WP 3.0 PAGED BUG FIX
  100.  
  101. if ( get_query_var('paged') )
  102.  
  103. $paged = get_query_var('paged');
  104.  
  105. elseif ( get_query_var('page') )
  106.  
  107. $paged = get_query_var('page');
  108.  
  109. else
  110.  
  111. $paged = 1;
  112.  
  113.  
  114.  
  115. $args = array(
  116.  
  117. 'post_type' => 'post',
  118.  
  119. 'paged' => $paged );
  120.  
  121. query_posts($args);
  122.  
  123. ?>
  124.  
  125.  
  126.  
  127. <?php if (have_posts()) : $count = 0; ?>
  128.  
  129. <?php while (have_posts()) : the_post(); $count++; global $post; ?>
  130.  
  131.  
  132.  
  133.  
  134.  
  135. <?php get_template_part( 'content', 'single' ); ?>
  136.  
  137.  
  138.  
  139.  
  140.  
  141. <?php endwhile; ?>
  142.  
  143.  
  144.  
  145. <!-- begin #pagination -->
  146.  
  147. <?php if (function_exists("wpthemess_paginate")) { wpthemess_paginate(); } ?>
  148.  
  149. <!-- end #pagination -->
  150.  
  151.  
  152.  
  153. <?php else : ?>
  154.  
  155.  
  156.  
  157. <article id="post-not-found">
  158.  
  159. <header>
  160.  
  161. <h1><?php _e("No Posts Yet", "site5framework"); ?></h1>
  162.  
  163. </header>
  164.  
  165. <section class="post_content">
  166.  
  167. <p><?php _e("Sorry, What you were looking for is not here.", "site5framework"); ?></p>
  168.  
  169. </section>
  170.  
  171. </article>
  172.  
  173.  
  174.  
  175. <?php endif; ?>
  176.  
  177.  
  178.  
  179. </div> <!-- end #main -->
  180.  
  181.  
  182.  
  183. </div><!-- three-fourth -->
  184.  
  185.  
  186.  
  187. <div class="one-fourth last">
  188.  
  189. <?php get_template_part( 'blog', 'sidebar' ); ?>
  190.  
  191. </div>
  192.  
  193.  
  194.  
  195. </div> <!-- end #content -->
  196.  
  197. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement