Advertisement
Guest User

Static WordPress Page AND Lastest Posts

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