Guest User

Untitled

a guest
May 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Blog
  4. *
  5. * The blog page template displays the "blog-style" template on a sub-page.
  6. *
  7. * @package WooFramework
  8. * @subpackage Template
  9. */
  10.  
  11. get_header();
  12. global $woo_options;
  13.  
  14. /**
  15. * The Variables
  16. *
  17. * Setup default variables, overriding them if the "Theme Options" have been saved.
  18. */
  19.  
  20. $settings = array(
  21. 'thumb_w' => 75,
  22. 'thumb_h' => 75,
  23. 'thumb_align' => 'alignleft'
  24. );
  25.  
  26. $settings = woo_get_dynamic_values( $settings );
  27. ?>
  28. <!-- #content Starts -->
  29. <div id="content" class="col-full">
  30.  
  31. <!-- #main Starts -->
  32. <section id="main" class="col-right">
  33. <?php
  34. // Load the front page search form.
  35. get_template_part( 'includes/advanced-search-form' );
  36.  
  37. // Load the filter bar.
  38. get_template_part( 'includes/filter-bar' );
  39. ?>
  40. <?php if ( isset( $woo_options['woo_breadcrumbs_show'] ) && $woo_options['woo_breadcrumbs_show'] == 'true' ) { ?>
  41. <section id="breadcrumbs">
  42. <?php woo_breadcrumbs(); ?>
  43. </section><!--/#breadcrumbs -->
  44. <?php } ?>
  45.  
  46. <?php
  47. if ( get_query_var( 'paged') ) { $paged = get_query_var( 'paged' ); } elseif ( get_query_var( 'page') ) { $paged = get_query_var( 'page' ); } else { $paged = 1; }
  48.  
  49. $query_args = array(
  50. 'post_type' => 'post',
  51. 'paged' => $paged
  52. );
  53.  
  54. $query_args = apply_filters( 'woo_blog_template_query_args', $query_args ); // Do not remove. Used to exclude categories from displaying here.
  55. remove_filter( 'pre_get_posts', 'woo_exclude_categories_homepage' );
  56. query_posts( $query_args );
  57.  
  58. if ( have_posts() ) {
  59. $count = 0;
  60. while ( have_posts() ) { the_post(); $count++;
  61. ?>
  62. <!-- Post Starts -->
  63. <article <?php post_class(); ?>>
  64.  
  65. <?php
  66. $image = woo_image( 'return=true&width=' . $settings['thumb_w'] . '&height=' . $settings['thumb_h'] . '&link=img&class=thumbnail' );
  67.  
  68. if ( $image != '' ) {
  69. ?>
  70.  
  71. <?php if ( isset( $woo_options['woo_post_content'] ) && $woo_options['woo_post_content'] != 'content' ) { ?>
  72. <div class="drop-shadow curved curved-hz-1 <?php echo $settings['thumb_align']; ?>">
  73. <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>" >
  74. <?php echo $image; ?>
  75. </a>
  76. </div><!--/.drop-shadow-->
  77.  
  78. <?php }} ?>
  79.  
  80. <div class="container">
  81.  
  82. <header>
  83.  
  84. <h1 class="title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
  85.  
  86. <?php woo_post_meta(); ?>
  87.  
  88. </header>
  89.  
  90. <section class="entry">
  91. <?php if ( isset( $woo_options['woo_post_content'] ) && $woo_options['woo_post_content'] == 'content' ) { the_content( __( 'Continue Reading &rarr;', 'woothemes' ) ); } else { the_excerpt(); } ?>
  92. </section>
  93.  
  94. <div class="comments">
  95. <?php comments_popup_link( __( '0', 'woothemes' ), __( '1', 'woothemes' ), __( '%', 'woothemes' ) ); ?>
  96. </div>
  97.  
  98. </div><!-- /.container -->
  99.  
  100. <div class="fix"></div>
  101.  
  102. </article><!-- /.post -->
  103.  
  104. <?php
  105. } // End WHILE Loop
  106.  
  107. } else {
  108. ?>
  109. <article <?php post_class(); ?>>
  110. <p><?php _e( 'Sorry, no posts matched your criteria.', 'woothemes' ); ?></p>
  111. </article><!-- /.post -->
  112. <?php } // End IF Statement ?>
  113.  
  114. <?php if ( isset( $woo_options['woo_pagenav_show'] ) && $woo_options['woo_pagenav_show'] == 'true' ) { woo_pagenav(); } ?>
  115. <?php wp_reset_query(); ?>
  116.  
  117. </section><!-- /#main -->
  118.  
  119. <?php get_sidebar(); ?>
  120.  
  121. </div><!-- /#content -->
  122.  
  123. <?php get_footer(); ?>
Add Comment
Please, Sign In to add comment