SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | ||
3 | // Exit if accessed directly | |
4 | if ( !defined('ABSPATH')) exit; | |
5 | ||
6 | /** | |
7 | * Home Page Template | |
8 | * | |
9 | Template Name: Home Page (w/ home widgets) | |
10 | * | |
11 | * @file home-page.php | |
12 | * @package Responsive | |
13 | * @author Emil Uzelac | |
14 | * @copyright 2003 - 2011 ThemeID | |
15 | * @license license.txt | |
16 | * @version Release: 1.0 | |
17 | * @filesource wp-content/themes/responsive/full-width-page.php | |
18 | * @link http://codex.wordpress.org/Theme_Development#Pages_.28page.php.29 | |
19 | * @since available since Release 1.0 | |
20 | */ | |
21 | ?> | |
22 | <?php get_header(); ?> | |
23 | ||
24 | - | <div id="content-full" class="grid col-940"> |
24 | + | <div id="featured" class="grid col-940"> |
25 | ||
26 | - | <?php if (have_posts()) : ?> |
26 | + | <div class="grid col-460"> |
27 | ||
28 | - | <?php while (have_posts()) : the_post(); ?> |
28 | + | <?php $options = get_option('responsive_theme_options'); |
29 | // First let's check if headline was set | |
30 | - | <?php $options = get_option('responsive_theme_options'); ?> |
30 | + | if ($options['home_headline']) { |
31 | - | <?php if ($options['breadcrumb'] == 0): ?> |
31 | + | echo '<h1 class="featured-title">'; |
32 | - | <?php echo responsive_breadcrumb_lists(); ?> |
32 | + | echo $options['home_headline']; |
33 | - | <?php endif; ?> |
33 | + | echo '</h1>'; |
34 | // If not display dummy headline for preview purposes | |
35 | - | <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
35 | + | } else { |
36 | - | <h1 class="post-title"><?php the_title(); ?></h1> |
36 | + | echo '<h1 class="featured-title">'; |
37 | - | |
37 | + | echo __('Hello, World!','responsive'); |
38 | - | <?php if ( comments_open() ) : ?> |
38 | + | echo '</h1>'; |
39 | - | <div class="post-meta"> |
39 | + | } |
40 | - | <?php |
40 | + | ?> |
41 | - | printf( __( '<span class="%1$s">Posted on</span> %2$s by %3$s', 'responsive' ),'meta-prep meta-prep-author', |
41 | + | |
42 | - | sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>', |
42 | + | <?php $options = get_option('responsive_theme_options'); |
43 | - | get_permalink(), |
43 | + | // First let's check if headline was set |
44 | - | esc_attr( get_the_time() ), |
44 | + | if ($options['home_subheadline']) { |
45 | - | get_the_date() |
45 | + | echo '<h2 class="featured-subtitle">'; |
46 | - | ), |
46 | + | echo $options['home_subheadline']; |
47 | - | sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', |
47 | + | echo '</h2>'; |
48 | - | get_author_posts_url( get_the_author_meta( 'ID' ) ), |
48 | + | // If not display dummy headline for preview purposes |
49 | - | sprintf( esc_attr__( 'View all posts by %s', 'responsive' ), get_the_author() ), |
49 | + | } else { |
50 | - | get_the_author() |
50 | + | echo '<h2 class="featured-subtitle">'; |
51 | - | ) |
51 | + | echo __('Your H2 subheadline here','responsive'); |
52 | - | ); |
52 | + | echo '</h2>'; |
53 | - | ?> |
53 | + | } |
54 | - | <?php if ( comments_open() ) : ?> |
54 | + | ?> |
55 | - | <span class="comments-link"> |
55 | + | |
56 | - | <span class="mdash">—</span> |
56 | + | <?php $options = get_option('responsive_theme_options'); |
57 | - | <?php comments_popup_link(__('No Comments ↓', 'responsive'), __('1 Comment ↓', 'responsive'), __('% Comments ↓', 'responsive')); ?> |
57 | + | // First let's check if content is in place |
58 | - | </span> |
58 | + | if (!empty($options['home_content_area'])) { |
59 | - | <?php endif; ?> |
59 | + | echo '<p>'; |
60 | - | </div><!-- end of .post-meta --> |
60 | + | echo do_shortcode($options['home_content_area']); |
61 | - | <?php endif; ?> |
61 | + | echo '</p>'; |
62 | - | |
62 | + | // If not let's show dummy content for demo purposes |
63 | - | <div class="post-entry"> |
63 | + | } else { |
64 | - | <?php the_content(__('Read more ›', 'responsive')); ?> |
64 | + | echo '<p>'; |
65 | - | <?php wp_link_pages(array('before' => '<div class="pagination">' . __('Pages:', 'responsive'), 'after' => '</div>')); ?> |
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 | - | </div><!-- end of .post-entry --> |
66 | + | echo '</p>'; |
67 | - | |
67 | + | } |
68 | - | <?php if ( comments_open() ) : ?> |
68 | + | ?> |
69 | - | <div class="post-data"> |
69 | + | |
70 | - | <?php the_tags(__('Tagged with:', 'responsive') . ' ', ', ', '<br />'); ?> |
70 | + | <?php $options = get_option('responsive_theme_options'); ?> |
71 | - | <?php the_category(__('Posted in %s', 'responsive') . ', '); ?> |
71 | + | <?php if ($options['cta_button'] == 0): ?> |
72 | - | </div><!-- end of .post-data --> |
72 | + | <div class="call-to-action"> |
73 | - | <?php endif; ?> |
73 | + | |
74 | <?php $options = get_option('responsive_theme_options'); | |
75 | - | <div class="post-edit"><?php edit_post_link(__('Edit', 'responsive')); ?></div> |
75 | + | // First let's check if headline was set |
76 | - | </div><!-- end of #post-<?php the_ID(); ?> --> |
76 | + | if (!empty($options['cta_url']) && $options['cta_text']) { |
77 | echo '<a href="'.$options['cta_url'].'" class="blue button">'; | |
78 | - | <?php comments_template( '', true ); ?> |
78 | + | echo $options['cta_text']; |
79 | echo '</a>'; | |
80 | - | <?php endwhile; ?> |
80 | + | // If not display dummy headline for preview purposes |
81 | } else { | |
82 | - | <?php if ( $wp_query->max_num_pages > 1 ) : ?> |
82 | + | echo '<a href="#nogo" class="blue button">'; |
83 | - | <div class="navigation"> |
83 | + | echo __('Call to Action','responsive'); |
84 | - | <div class="previous"><?php next_posts_link( __( '‹ Older posts', 'responsive' ) ); ?></div> |
84 | + | echo '</a>'; |
85 | - | <div class="next"><?php previous_posts_link( __( 'Newer posts ›', 'responsive' ) ); ?></div> |
85 | + | } |
86 | - | </div><!-- end of .navigation --> |
86 | + | ?> |
87 | - | <?php endif; ?> |
87 | + | |
88 | </div><!-- end of .call-to-action --> | |
89 | - | <?php else : ?> |
89 | + | <?php endif; ?> |
90 | ||
91 | - | <h1 class="title-404"><?php _e('404 — Fancy meeting you here!', 'responsive'); ?></h1> |
91 | + | </div><!-- end of .col-460 --> |
92 | - | <p><?php _e('Don't panic, we'll get through this together. Let's explore our options here.', 'responsive'); ?></p> |
92 | + | |
93 | - | <h6><?php _e( 'You can return', 'responsive' ); ?> <a href="<?php echo home_url(); ?>/" title="<?php esc_attr_e( 'Home', 'responsive' ); ?>"><?php _e( '← Home', 'responsive' ); ?></a> <?php _e( 'or search for the page you were looking for', 'responsive' ); ?></h6> |
93 | + | <div id="featured-image" class="grid col-460 fit"> |
94 | - | <?php get_search_form(); ?> |
94 | + | |
95 | <?php $options = get_option('responsive_theme_options'); | |
96 | - | <?php endif; ?> |
96 | + | // First let's check if image was set |
97 | - | |
97 | + | if (!empty($options['featured_content'])) { |
98 | - | </div><!-- end of #content-full --> |
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(); ?> |