Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Template Name: Front Page 2
- */
- ?>
- <?php
- /**
- * The main template file.
- *
- * This is the most generic template file in a WordPress theme
- * and one of the two required files for a theme (the other being style.css).
- * It is used to display a page when nothing more specific matches a query.
- * E.g., it puts together the home page when no home.php file exists.
- * Learn more: http://codex.wordpress.org/Template_Hierarchy
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- */
- get_header();
- ?>
- <div id="primary">
- <div id="content_head" role="main_head">
- <div id="home-slider">
- <?php
- /**
- * You can change the slider (integer) ID on "get_smooth_slider('ID');" from this page
- * http://bearleaderchronicle.com/pre/wp-admin/admin.php?page=smooth-slider-admin
- */
- ?>
- <?php
- if (function_exists('get_smooth_slider')) {
- get_smooth_slider(2);
- }
- ?>
- </div>
- </div><!-- #content_head -->
- <div id="content_left" role="main_left">
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <?php
- $instance = array();
- $instance = array_merge(array(
- 'limit' => 7,
- 'offset' => 0,
- 'excerpt' => true,
- 'length' => 160,
- 'thumb' => true,
- 'thumb_height' => 309,
- 'thumb_width' => 309,
- 'cat' => '935',
- 'post_type' => 'post',
- 'date' => true,
- ), $instance);
- $limit = $instance['limit'];
- $offset = $instance['offset'];
- $excerpt = $instance['excerpt'];
- $length = (int) ( $instance['length'] );
- $thumb = $instance['thumb'];
- $thumb_height = (int) ( $instance['thumb_height'] );
- $thumb_width = (int) ( $instance['thumb_width'] );
- $cat = $instance['cat'];
- $post_type = $instance['post_type'];
- $date = $instance['date'];
- //$css = wp_filter_nohtml_kses($instance['css']);
- //$sticky = get_field('sticky_post');
- //var_dump($sticky);
- static $exclude_ids;
- // WP_Query arguments
- $args = array(
- 'offset' => $offset,
- //'post__in' => $sticky,
- 'posts_per_page' => $limit,
- 'cat' => $cat,
- 'post_type' => $post_type,
- 'post__not_in' => $exclude_ids,
- 'orderby' => 'rand'
- );
- // The Query
- $query = new WP_Query($args);
- ?>
- <div class="rpwebb-block">
- <?php if ($query->have_posts()) : ?>
- <ul>
- <?php while ($query->have_posts()) : $query->the_post(); ?>
- <?php $custom_fp_class = get_post_meta($post->ID, 'fp_post_style', true); ?>
- <?php
- $exclude_ids[] = get_the_ID();
- $ext_url = get_post_meta(get_the_ID(), 'RPW_externalurl', true);
- $ext_url = !empty($ext_url) ? $ext_url : get_permalink();
- ?>
- <li class="rpwe-clearfix <?php echo ' ' . $custom_fp_class; ?>" >
- <?php if (has_post_thumbnail() && $thumb == true) { ?>
- <a href="<?php echo $ext_url; ?>" class="<?php echo ($thumb_width < $thumb_height) ? 'height-alto' : 'no-alto' ?>" title="<?php printf(esc_attr__('Permalink to %s', 'rpwe'), the_title_attribute('echo=0')); ?>" rel="bookmark">
- <?php
- if (current_theme_supports('get-the-image'))
- get_the_image(array('meta_key' => 'Thumbnail', 'height' => $thumb_height, 'width' => $thumb_width, 'image_class' => 'rpwe-alignleft', 'link_to_post' => false));
- else
- the_post_thumbnail(array($thumb_width, $thumb_height), array('class' => 'rpwe-alignleft', 'alt' => esc_attr(get_the_title()), 'title' => esc_attr(get_the_title())));
- ?>
- </a>
- <?php } ?>
- <h3 class="rpwe-title">
- <a href="<?php echo $ext_url; ?>" title="<?php printf(esc_attr__('Permalink to %s', 'rpwe'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a>
- </h3>
- <?php if ($date == true) { ?>
- <span class="rpwe-time"><?php echo the_time('g:i a'); ?></span>
- <?php } ?>
- <?php if(get_field('fp_author')) { echo '<p class="fp_author">' . get_field('fp_author') . '</p>';}
- ?>
- <?php if ($ago == true) { ?>
- <span class="rpwe-time"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago', 'rpwe'); ?></span>
- <?php } ?>
- <?php if ($excerpt == true) { ?>
- <div class="rpwe-summary"><p><?php echo blc_excerpt($length); ?></p><p><a href="<?php echo $ext_url; ?>">Read more ></a></p></div>
- <?php } ?>
- </li>
- <?php endwhile; ?>
- <?php wp_reset_postdata(); ?>
- </ul>
- <?php endif; ?>
- </div>
- <div class="clear"></div>
- <footer class="entry-meta">
- <?php edit_post_link(__('Edit', 'twentyeleven'), '<span class="edit-link">', '</span>'); ?>
- <div class="clear"></div>
- </footer><!-- .entry-meta -->
- <div class="clear"></div>
- </article><!-- #post-<?php the_ID(); ?> -->
- </div><!-- #content_left -->
- <div id="content_right" role="main_right">
- <?php
- // WP_Query arguments
- global $paged;
- $paged = ( get_query_var('page') ) ? get_query_var('page') : 1;
- $args = array(
- 'paged' => $paged,
- 'cat' => blc_get_main_categories(),
- // MN input "3" on the next line instead of this-> get_option('posts_per_page'),
- 'posts_per_page' => 3
- );
- // The Query
- $query = new WP_Query($args);
- ?>
- <?php if ($query->have_posts()) : ?>
- <?php /* Start the Loop */ ?>
- <?php while ($query->have_posts()) : $query->the_post(); ?>
- <?php get_template_part('content', 'home2'); ?>
- <?php endwhile; ?>
- <?php wp_reset_postdata(); ?>
- <?php else : ?>
- <article id="post-0" class="post no-results not-found">
- <header class="entry-header">
- <h1 class="entry-title"><?php _e('Nothing Found!', 'twentyeleven'); ?></h1>
- </header><!-- .entry-header -->
- <div class="entry-content">
- <p><?php _e('Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven'); ?></p>
- <?php get_search_form(); ?>
- </div><!-- .entry-content -->
- </article><!-- #post-0 -->
- <?php endif; ?>
- </div><!-- #content_right -->
- <div id="content_video" role="main_video">
- <header class="bottom-sec-headers">Latest Video</header>
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <?php
- $instance = array();
- $instance = array_merge(array(
- 'limit' => 7,
- 'offset' => 0,
- 'excerpt' => true,
- 'length' => 160,
- 'thumb' => true,
- 'thumb_height' => 309,
- 'thumb_width' => 309,
- 'cat' => '935',
- 'post_type' => 'post',
- 'date' => true,
- ), $instance);
- $limit = $instance['limit'];
- $offset = $instance['offset'];
- $excerpt = $instance['excerpt'];
- $length = (int) ( $instance['length'] );
- $thumb = $instance['thumb'];
- $thumb_height = (int) ( $instance['thumb_height'] );
- $thumb_width = (int) ( $instance['thumb_width'] );
- $cat = $instance['cat'];
- $post_type = $instance['post_type'];
- $date = $instance['date'];
- //$css = wp_filter_nohtml_kses($instance['css']);
- //$sticky = get_field('sticky_post');
- //var_dump($sticky);
- static $exclude_ids;
- // WP_Query arguments
- $args = array(
- 'offset' => $offset,
- //'post__in' => $sticky,
- 'posts_per_page' => $limit,
- 'cat' => $cat,
- 'post_type' => $post_type,
- 'post__not_in' => $exclude_ids,
- 'orderby' => 'rand'
- );
- // The Query
- $query = new WP_Query($args);
- ?>
- <div class="rpwebb-block">
- <?php if ($query->have_posts()) : ?>
- <ul>
- <?php while ($query->have_posts()) : $query->the_post(); ?>
- <?php $custom_fp_class = get_post_meta($post->ID, 'fp_post_style', true); ?>
- <?php
- $exclude_ids[] = get_the_ID();
- $ext_url = get_post_meta(get_the_ID(), 'RPW_externalurl', true);
- $ext_url = !empty($ext_url) ? $ext_url : get_permalink();
- ?>
- <li class="rpwe-clearfix <?php echo ' ' . $custom_fp_class; ?>" >
- <?php if (has_post_thumbnail() && $thumb == true) { ?>
- <a href="<?php echo $ext_url; ?>" class="<?php echo ($thumb_width < $thumb_height) ? 'height-alto' : 'no-alto' ?>" title="<?php printf(esc_attr__('Permalink to %s', 'rpwe'), the_title_attribute('echo=0')); ?>" rel="bookmark">
- <?php
- if (current_theme_supports('get-the-image'))
- get_the_image(array('meta_key' => 'Thumbnail', 'height' => $thumb_height, 'width' => $thumb_width, 'image_class' => 'rpwe-alignleft', 'link_to_post' => false));
- else
- the_post_thumbnail(array($thumb_width, $thumb_height), array('class' => 'rpwe-alignleft', 'alt' => esc_attr(get_the_title()), 'title' => esc_attr(get_the_title())));
- ?>
- </a>
- <?php } ?>
- <h3 class="rpwe-title">
- <a href="<?php echo $ext_url; ?>" title="<?php printf(esc_attr__('Permalink to %s', 'rpwe'), the_title_attribute('echo=0')); ?>" rel="bookmark"><?php the_title(); ?></a>
- </h3>
- <?php if ($date == true) { ?>
- <span class="rpwe-time"><?php echo the_time('g:i a'); ?></span>
- <?php } ?>
- <?php if(get_field('fp_author')) { echo '<p class="fp_author">' . get_field('fp_author') . '</p>';}
- ?>
- <?php if ($ago == true) { ?>
- <span class="rpwe-time"><?php echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago', 'rpwe'); ?></span>
- <?php } ?>
- <?php if ($excerpt == true) { ?>
- <div class="rpwe-summary"><p><?php echo blc_excerpt($length); ?></p><p><a href="<?php echo $ext_url; ?>">Read more ></a></p></div>
- <?php } ?>
- </li>
- <?php endwhile; ?>
- <?php wp_reset_postdata(); ?>
- </ul>
- <?php endif; ?>
- </div>
- <div class="clear"></div>
- <footer class="entry-meta">
- <?php edit_post_link(__('Edit', 'twentyeleven'), '<span class="edit-link">', '</span>'); ?>
- <div class="clear"></div>
- </footer><!-- .entry-meta -->
- <div class="clear"></div>
- </article><!-- #post-<?php the_ID(); ?> -->
- </div><!-- #content_video -->
- <div id="content_eat" role="main_eat">
- <header class="bottom-sec-headers">Eat</header>
- </div><!-- #content_eat -->
- <div id="content_stay" role="main_stay">
- <header class="bottom-sec-headers">Stay</header>
- </div><!-- #content_stay -->
- <div id="content_city-guide" role="main_city-guide">
- <header class="bottom-sec-headers">City Guides</header>
- </div><!-- #content_city-guide -->
- <div id="content_thoughts-on-travel" role="main_thoughts-on-travel">
- <header class="bottom-sec-headers">Thoughts on Travel</header>
- </div><!-- #content_thoughts-on-travel -->
- </div><!-- #primary -->
- <?php get_sidebar(); ?>
- <div class="clear"></div>
- <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement