netztaucher

loop-serie.php

Jun 24th, 2014
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.63 KB | None | 0 0
  1. <?php
  2. global $avia_config, $post_loop_count;
  3.  
  4. $post_loop_count= 1;
  5. $post_class     = "post-entry-".avia_get_the_id();
  6.  
  7.  
  8.  
  9. // check if we got posts to display:
  10. if (have_posts()) :
  11.  
  12.     while (have_posts()) : the_post();
  13. ?>
  14.  
  15.  
  16. Template Serie
  17.  
  18.         <article class='post-entry post-entry-type-page <?php echo $post_class; ?>' <?php avia_markup_helper(array('context' => 'entry')); ?>>
  19.  
  20.             <div class="entry-content-wrapper clearfix">
  21.                 <?php
  22.                 echo '<header class="entry-content-header">';
  23.                     $thumb = get_the_post_thumbnail(get_the_ID(), $avia_config['size']);
  24.  
  25.                     if($thumb) echo "<div class='page-thumb'>{$thumb}</div>";
  26.                 echo '</header>';
  27.  
  28.                 //display the actual post content
  29.                 echo '<div class="entry-content" '.avia_markup_helper(array('context' => 'entry_content','echo'=>false)).'>';
  30.                     the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>');
  31.                 echo '</div>';
  32.  
  33.                 echo '<footer class="entry-footer">';
  34.                 wp_link_pages(array('before' =>'<div class="pagination_split_post">',
  35.                                         'after'  =>'</div>',
  36.                                         'pagelink' => '<span>%</span>'
  37.                                         ));
  38.                 echo '</footer>';
  39.                
  40.                 do_action('ava_after_content', get_the_ID(), 'page');
  41.                
  42.  
  43.     $post_loop_count++;
  44.     endwhile;
  45.     else:
  46. ?>
  47.  
  48.  
  49.  
  50.            
  51.                
  52. ---------item after content start----------
  53.  
  54.  
  55. <?php
  56. // WP_Query arguments
  57. $args = array (
  58.     'post_type'              => 'post',
  59.     'cat'                    => '217',
  60.     'pagination'             => false,
  61.     'order'                  => 'ASC',
  62.     'meta_query'             => array(
  63.         array(
  64.             'key'       => 'series_excerpt',
  65.         ),
  66.     ),
  67. );
  68.  
  69. // The Query
  70. $series = new WP_Query( $args );
  71.  
  72. // The Loop
  73. if ( $series->have_posts() ) {
  74.     while ( $series->have_posts() ) {
  75.         $series->the_post();
  76.         // do something
  77. ?>
  78.  
  79.     <h2><?php the_title(); ?></h2>
  80.  
  81.  
  82. <?php
  83.     }
  84. } else {
  85.     // no posts found
  86. }
  87.  
  88. // Restore original Post Data
  89. wp_reset_postdata();?>
  90.  
  91.            
  92. ---------item after content stop----------
  93.  
  94.  
  95.  
  96.  
  97.  
  98.     <article class="entry">
  99.         <header class="entry-content-header">
  100.             <h1 class='post-title entry-title'><?php _e('Nothing Found', 'avia_framework'); ?></h1>
  101.         </header>
  102.  
  103.         <?php get_template_part('includes/error404'); ?>
  104.  
  105.         <footer class="entry-footer"></footer>
  106.     </article>
  107.  
  108. <?php
  109.  
  110.     endif;
  111. ?>
Advertisement
Add Comment
Please, Sign In to add comment