Advertisement
lordaker

Header Page : Snowbird

Jul 27th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <header class="xf__header">
  4.     <div class="content xf__container">
  5. <?php //exemple ici
  6.     switch (the_title()) {
  7.         case "Home":
  8.             $img = 438; //id de l'image upload
  9.             break;
  10.     }
  11.     $image_attributes = wp_get_attachment_image_src( $img );
  12.     if ( $image_attributes ) : ?>
  13. <img src="<?php echo $image_attributes[0]; ?>" width="<?php echo $image_attributes[1]; ?>" height="<?php echo $image_attributes[2]; ?>" />
  14. <?php endif; // fin ici ?>
  15.         <?php the_title( '<h1 class="xf__page-title" itemprop="headline">', '</h1>' ); ?>
  16.     </div>
  17.  
  18.     <?php
  19.     /**
  20.      * Featured Image
  21.      */
  22.     get_template_part( 'template-parts/featured-image-page' ); ?>
  23. </header>
  24.  
  25. <main class="xf__main" itemprop="mainContentOfPage">
  26.     <?php while ( have_posts() ) : the_post(); ?>
  27.  
  28.         <div itemscope="itemscope" itemtype="http://schema.org/CreativeWork">
  29.             <?php
  30.             /**
  31.              * Page Content
  32.              */
  33.             get_template_part( 'template-parts/content-page' ); ?>
  34.  
  35.             <?php
  36.             /**
  37.              * Comments and Form
  38.              */
  39.             comments_template(); ?>
  40.         </div>
  41.  
  42.     <?php endwhile; ?>
  43. </main>
  44.  
  45. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement