Advertisement
Guest User

WordPress Page with News

a guest
Jan 30th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.24 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Static Page with News
  4. */
  5.  
  6. get_header(); ?>
  7.  
  8. <main id="main" class="site-main" role="main">
  9.  
  10.     <div class="static">
  11.  
  12.     <?php
  13.    // 1. Loop to display the static content
  14.    if (have_posts()) : while (have_posts()) : the_post();
  15.    ?>
  16.            
  17.     <?php the_content(); ?>
  18.     <?php endwhile; ?>
  19.     <?php endif; ?>
  20.    
  21.     </div>
  22.    
  23.     <h4>NEWS</h4>
  24.        
  25.     <?php query_posts('cat=0&showposts=10');?>
  26.     <?php if (have_posts()) : ?>
  27.         <?php global $more; $more = 0; ?>
  28.         <?php while (have_posts()) : the_post(); ?>
  29.        
  30.         <?php endwhile; ?>
  31.        
  32.         <?php else : ?>
  33.        
  34.         <?php endif; ?>
  35.    
  36. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  37.     <div class="archive-post-wrap">
  38.         <?php
  39.         /**
  40.          * catchresponsive_before_entry_container hook
  41.          *
  42.          * @hooked catchresponsive_archive_content_image - 10
  43.          */
  44.         do_action( 'catchresponsive_before_entry_container' ); ?>
  45.  
  46.         <div class="entry-container">
  47.             <header class="entry-header">
  48.                 <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  49.  
  50.                 <?php if ( 'post' == get_post_type() ) : ?>
  51.  
  52.                     <?php catchresponsive_entry_meta(); ?>
  53.  
  54.                 <?php endif; ?>
  55.             </header><!-- .entry-header -->
  56.  
  57.             <?php
  58.             $options = catchresponsive_get_theme_options();
  59.  
  60.             if ( is_search() || 'full-content' != $options['content_layout'] ) : // Only display Excerpts for Search and if 'full-content' is not selected ?>
  61.                 <div class="entry-summary">
  62.                     <?php the_excerpt(); ?>
  63.                 </div><!-- .entry-summary -->
  64.             <?php else : ?>
  65.                 <div class="entry-content">
  66.                     <?php the_content(); ?>
  67.                     <?php
  68.                         wp_link_pages( array(
  69.                             'before' => '<div class="page-links"><span class="pages">' . __( 'Pages:', 'catch-responsive-pro' ) . '</span>',
  70.                             'after'  => '</div>',
  71.                             'link_before'   => '<span>',
  72.                             'link_after'    => '</span>',
  73.                         ) );
  74.                     ?>
  75.                 </div><!-- .entry-content -->
  76.             <?php endif; ?>
  77.  
  78.             <footer class="entry-footer">
  79.                 <?php catchresponsive_tag_category(); ?>
  80.             </footer><!-- .entry-footer -->
  81.         </div><!-- .entry-container -->
  82.     </div><!-- .archive-post-wrap -->
  83. </article><!-- #post -->
  84.    
  85. </main>
  86.  
  87. <?php get_sidebar(); ?>
  88. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement