Advertisement
catchmahesh

content-page.php (catch box pro)

Mar 31st, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template used for displaying page content in page.php
  4.  *
  5.  * @package Catch Themes
  6.  * @subpackage Catch_Box
  7.  * @since Catch Box 1.0
  8.  */
  9. ?>
  10.  
  11. <?php
  12.     $background = '';
  13.     // check for a Featured Image and then assign it to a PHP variable for later use
  14.     if ( has_post_thumbnail() ) {
  15.         $featured_image = wp_get_attachment_image_src( get_post_thumbnail_id());
  16.         $background = 'background-image: url('.$featured_image[0].');';
  17.         $background .= 'background-repeat: no-repeat;';
  18.         $background .= 'background-size: cover;';
  19.         $background .= 'background-position: center;';
  20.     }
  21. ?>
  22.  
  23. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> style="<?php echo $background; ?>">
  24.     <header class="entry-header">
  25.         <h1 class="entry-title"><?php the_title(); ?></h1>
  26.     </header><!-- .entry-header -->
  27.  
  28.     <div class="entry-content">
  29.         <?php the_content(); ?>
  30.         <?php wp_link_pages( array(
  31.             'before'        => '<div class="page-link"><span class="pages">' . __( 'Pages:', 'catch-box-pro' ) . '</span>',
  32.             'after'         => '</div>',
  33.             'link_before'   => '<span>',
  34.             'link_after'    => '</span>',
  35.         ) );
  36.         ?>
  37.     </div><!-- .entry-content -->
  38.     <footer class="entry-meta">
  39.         <?php edit_post_link( __( 'Edit', 'catch-box-pro' ), '<span class="edit-link">', '</span>' ); ?>
  40.     </footer><!-- .entry-meta -->
  41. </article><!-- #post-<?php the_ID(); ?> -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement