Advertisement
grappler

home-page.php

Sep 10th, 2012
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.90 KB | None | 0 0
  1. <?php
  2.  
  3. // Exit if accessed directly
  4. if ( !defined('ABSPATH')) exit;
  5.  
  6. /**
  7.  * Full Content Template
  8.  *
  9.    Template Name:  Home
  10.  *
  11.  * @file           home-page.php
  12.  * @package        Responsive
  13.  * @author         Emil Uzelac
  14.  * @copyright      2003 - 2012 ThemeID
  15.  * @license        license.txt
  16.  * @version        Release: 1.0
  17.  * @filesource     wp-content/themes/responsive/home.php
  18.  * @link           http://codex.wordpress.org/Template_Hierarchy
  19.  * @since          available since Release 1.0
  20.  */
  21. ?>
  22. <?php get_header(); ?>
  23.  
  24.         <div id="featured" class="grid col-940">
  25.        
  26.         <div class="grid col-460">
  27.  
  28.             <?php $options = get_option('responsive_theme_options');
  29.             // First let's check if headline was set
  30.                 if ($options['home_headline']) {
  31.                     echo '<h1 class="featured-title">';
  32.                     echo $options['home_headline'];
  33.                     echo '</h1>';
  34.             // If not display dummy headline for preview purposes
  35.                   } else {
  36.                     echo '<h1 class="featured-title">';
  37.                     echo __('Hello, World!','responsive');
  38.                     echo '</h1>';
  39.                   }
  40.             ?>
  41.                    
  42.             <?php $options = get_option('responsive_theme_options');
  43.             // First let's check if headline was set
  44.                 if ($options['home_subheadline']) {
  45.                     echo '<h2 class="featured-subtitle">';
  46.                     echo $options['home_subheadline'];
  47.                     echo '</h2>';
  48.             // If not display dummy headline for preview purposes
  49.                   } else {
  50.                     echo '<h2 class="featured-subtitle">';
  51.                     echo __('Your H2 subheadline here','responsive');
  52.                     echo '</h2>';
  53.                   }
  54.             ?>
  55.            
  56.             <?php $options = get_option('responsive_theme_options');
  57.             // First let's check if content is in place
  58.                 if (!empty($options['home_content_area'])) {
  59.                     echo '<p>';
  60.                     echo do_shortcode($options['home_content_area']);
  61.                     echo '</p>';
  62.             // If not let's show dummy content for demo purposes
  63.                   } else {
  64.                     echo '<p>';
  65.                     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');
  66.                     echo '</p>';
  67.                   }
  68.             ?>
  69.            
  70.             <?php $options = get_option('responsive_theme_options'); ?>
  71.             <?php if ($options['cta_button'] == 0): ?>    
  72.             <div class="call-to-action">
  73.  
  74.             <?php $options = get_option('responsive_theme_options');
  75.             // First let's check if headline was set
  76.                 if (!empty($options['cta_url']) && $options['cta_text']) {
  77.                     echo '<a href="'.$options['cta_url'].'" class="blue button">';
  78.                     echo $options['cta_text'];
  79.                     echo '</a>';
  80.             // If not display dummy headline for preview purposes
  81.                   } else {
  82.                     echo '<a href="#nogo" class="blue button">';
  83.                     echo __('Call to Action','responsive');
  84.                     echo '</a>';
  85.                   }
  86.             ?>  
  87.            
  88.             </div><!-- end of .call-to-action -->
  89.             <?php endif; ?>        
  90.            
  91.         </div><!-- end of .col-460 -->
  92.  
  93.         <div id="featured-image" class="grid col-460 fit">
  94.                            
  95.             <?php $options = get_option('responsive_theme_options');
  96.             // First let's check if image was set
  97.                 if (!empty($options['featured_content'])) {
  98.                     echo do_shortcode($options['featured_content']);
  99.             // If not display dummy image for preview purposes
  100.                   } else {            
  101.                     echo '<img class="aligncenter" src="'.get_stylesheet_directory_uri().'/images/featured-image.png" width="440" height="300" alt="" />';
  102.                   }
  103.             ?>
  104.                                    
  105.         </div><!-- end of #featured-image -->
  106.        
  107.         </div><!-- end of #featured -->
  108.                
  109. <?php get_sidebar('home'); ?>
  110. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement