Advertisement
grappler

home.php Canonical full post

Mar 4th, 2013
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.90 KB | None | 0 0
  1. <?php
  2.  
  3. // Exit if accessed directly
  4. if ( !defined('ABSPATH')) exit;
  5.  
  6. /**
  7.  * Home Page
  8.  *
  9.  *
  10.  * @file           home.php
  11.  * @package        Responsive
  12.  * @author         Emil Uzelac
  13.  * @copyright      2003 - 2012 ThemeID
  14.  * @license        license.txt
  15.  * @version        Release: 1.0
  16.  * @filesource     wp-content/themes/responsive-canonical/home.php
  17.  * @link           http://codex.wordpress.org/Template_Hierarchy
  18.  * @since          available since Release 1.0
  19.  */
  20. ?>
  21. <?php get_header(); ?>
  22.  
  23.         <div id="featured" class="grid col-940">
  24.  
  25.             <?php $options = get_option('responsive_theme_options');
  26.             // First let's check if headline was set
  27.                 if ($options['home_headline']) {
  28.                     echo '<h1 class="featured-title">';
  29.                     echo $options['home_headline'];
  30.                     echo '</h1>';
  31.             // If not display dummy headline for preview purposes
  32.                   } else {
  33.                     echo '<h1 class="featured-title">';
  34.                     echo __('Hello, World!','responsive');
  35.                     echo '</h1>';
  36.                   }
  37.             ?>
  38.                    
  39.            
  40.             <?php $options = get_option('responsive_theme_options');
  41.             // First let's check if content is in place
  42.                 if (!empty($options['home_content_area'])) {
  43.                     echo '<p>';
  44.                     echo do_shortcode($options['home_content_area']);
  45.                     echo '</p>';
  46.             // If not let's show dummy content for demo purposes
  47.                   } else {
  48.                     echo '<p>';
  49.                     echo __('Your title, subtitle and this very content is editable from Theme Option. Call to Action button and its destination link as well. Image on your right can be an image or even YouTube video if you like.','responsive');
  50.                     echo '</p>';
  51.                   }
  52.             ?>
  53.            
  54.             <?php $options = get_option('responsive_theme_options'); ?>
  55.             <?php if ($options['cta_button'] == 0): ?>    
  56.             <div class="call-to-action">
  57.  
  58.             <?php $options = get_option('responsive_theme_options');
  59.             // First let's check if headline was set
  60.                 if (!empty($options['cta_url']) && $options['cta_text']) {
  61.                     echo '<a href="'.$options['cta_url'].'" class="orange button">';
  62.                     echo $options['cta_text'];
  63.                     echo '</a>';
  64.             // If not display dummy headline for preview purposes
  65.                   } else {
  66.                     echo '<a href="#nogo" class="orange button">';
  67.                     echo __('Call to Action','responsive');
  68.                     echo '</a>';
  69.                   }
  70.             ?>  
  71.            
  72.             </div><!-- end of .call-to-action -->
  73.             <?php endif; ?>        
  74.        
  75.         </div><!-- end of #featured -->
  76.        
  77.         <div id="featured-middle" class="grid col-940">
  78.        
  79.         <div id="featured-image-title" class="grid col-460">
  80.        
  81.             <?php $options = get_option('responsive_theme_options');
  82.             // First let's check if headline was set
  83.                 if ($options['home_subheadline']) {
  84.                     echo '<h2 class="featured-subtitle">';
  85.                     echo $options['home_subheadline'];
  86.                     echo '</h2>';
  87.             // If not display dummy headline for preview purposes
  88.                   } else {
  89.                     echo '<h2 class="featured-subtitle">';
  90.                     echo __('Your H2 subheadline here','responsive');
  91.                     echo '</h2>';
  92.                   }
  93.             ?>
  94.  
  95.         </div><!-- end of #featured-image-title -->
  96.        
  97.         <div id="featured-image" class="grid col-460 fit">
  98.                            
  99.             <?php $options = get_option('responsive_theme_options');
  100.             // First let's check if imageor video was set
  101.                 if (!empty($options['featured_content'])) {
  102.                     echo do_shortcode($options['featured_content']);
  103.             // If not display dummy video for preview purposes
  104.                   } else {            
  105.                     echo '<iframe src="http://fast.wistia.com/embed/iframe/fh3u926d9i?controlsVisibleOnLoad=true&version=v1&videoHeight=248&videoWidth=440&volumeControl=true" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" width="440" height="248"></iframe>';
  106.                   }
  107.             ?>
  108.                                    
  109.         </div><!-- end of #featured-image -->
  110.        
  111.         </div><!-- end of #feaured-middle -->
  112.        
  113.         <div id="content-news" class="clearfix">
  114.        
  115.         <div class="grid col-620">
  116.  
  117.         <?php
  118.             if ( get_query_var('paged') )
  119.                 $paged = get_query_var('paged');
  120.             elseif ( get_query_var('page') )
  121.                 $paged = get_query_var('page');
  122.             else
  123.                 $paged = 1;
  124.             query_posts( array (
  125.                 // category name
  126.                 'category_name' => 'featured',
  127.                 // number of posts
  128.                 'posts_per_page' => 3
  129.                 )
  130.             );
  131.         ?>
  132.      
  133.         <?php if (have_posts()) : ?>
  134.  
  135.         <?php while (have_posts()) : the_post(); ?>
  136.        
  137.             <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  138.                
  139.                 <h1 class="post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'responsive'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></h1>
  140.                
  141.                 <div class="post-meta">
  142.                 <?php responsive_post_meta_data(); ?>
  143.                
  144.                     <?php if ( comments_open() ) : ?>
  145.                         <span class="comments-link">
  146.                         <span class="mdash">&mdash;</span>
  147.                     <?php comments_popup_link(__('No Comments &darr;', '1 Comment &darr;', '% Comments &darr;', 'responsive')); ?>
  148.                         </span>
  149.                     <?php endif; ?>
  150.                 </div><!-- end of .post-meta -->
  151.                
  152.                 <div class="post-entry">
  153.                     <?php if ( has_post_thumbnail()) : ?>
  154.                         <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  155.                     <?php the_post_thumbnail('featured-image', array('class' => 'aligncenter')); ?>
  156.                         </a>
  157.                     <?php endif; ?>
  158.                     <?php the_content(__('Read more &#8250;', 'responsive')); ?>
  159.                     <?php wp_link_pages(array('before' => '<div class="pagination">' . __('Pages:', 'responsive'), 'after' => '</div>')); ?>
  160.                 </div><!-- end of .post-entry -->
  161.                
  162.                 <div class="post-data">
  163.                     <?php the_tags(__('Tagged with:', 'responsive') . ' ', ', ', '<br />'); ?>
  164.                     <?php printf(__('Posted in %s', 'responsive'), get_the_category_list(', ')); ?>
  165.                 </div><!-- end of .post-data -->            
  166.  
  167.             <div class="post-edit"><?php edit_post_link(__('Edit', 'responsive')); ?></div>              
  168.             </div><!-- end of #post-<?php the_ID(); ?> -->
  169.            
  170.         <?php endwhile; ?>
  171.        
  172.         <?php if (  $wp_query->max_num_pages > 1 ) : ?>
  173.         <div class="navigation">
  174.             <div class="previous"><?php next_posts_link( __( '&#8249; Older posts', 'responsive' ) ); ?></div>
  175.             <div class="next"><?php previous_posts_link( __( 'Newer posts &#8250;', 'responsive' ) ); ?></div>
  176.         </div><!-- end of .navigation -->
  177.         <?php endif; ?>
  178.  
  179.         <?php else : ?>
  180.  
  181.         <h1 class="title-404"><?php _e('404 &#8212; Fancy meeting you here!', 'responsive'); ?></h1>
  182.        
  183.         <p><?php _e('Don&#39;t panic, we&#39;ll get through this together. Let&#39;s explore our options here.', 'responsive'); ?></p>
  184.        
  185.         <h6>
  186.             <?php _e( 'You can return', 'responsive' ); ?>
  187.             <a href="<?php echo home_url(); ?>" title="<?php esc_attr_e( 'Home', 'responsive' ); ?>">
  188.             <?php _e( '&larr; Home', 'responsive' ); ?></a>
  189.             <?php _e( 'or search for the page you were looking for', 'responsive' ); ?>
  190.         </h6>
  191.         <?php get_search_form(); ?>
  192.        
  193.         <?php endif; ?>
  194.  
  195.         </div><!-- end of .grid col-620-->              
  196.         <?php get_sidebar('home'); ?>
  197.         </div><!-- end of #content-news -->
  198.  
  199. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement