Skip to content

Instantly share code, notes, and snippets.

@GreggFranklin
Created September 16, 2012 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GreggFranklin/3733265 to your computer and use it in GitHub Desktop.
Save GreggFranklin/3733265 to your computer and use it in GitHub Desktop.
Still working on it
<?php
/*
Template Name: Home
*/
?>
<?php get_header(); ?>
<aside id="slider_wrap">
<div id="slider_home">
<div class="flexslider">
<ul class="slides">
<?php
$type = 'slider';
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'asc'
);
$sliders = new WP_Query($args);
if ($sliders->have_posts()) : while($sliders->have_posts()) : $sliders->the_post();
$custom = get_post_custom($post->ID);
// get full image from featured image if was not see full image url in Portfolio
$get_custom_options = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '', false );
$get_custom_image_url = $get_custom_options[0];
$get_custom_image_url = str_replace(home_url(),'', $get_custom_image_url);
$slider_image = get_template_directory_uri().'/functions/timthumb.php?src='.$get_custom_image_url.'&amp;w=970&amp;h=375&amp;zc=1';
$slider_website_url = '';
$slider_description = '';
$custom = get_post_custom($post->ID);
$slider_website_url = $custom["slider_website_url"][0];
$slider_description = $custom["slider_description"][0];
$slider_description_output = '';
if ($slider_description) {
$slider_description_output = '<p class="flex-caption">'.$slider_description.'</p>';
}
$slider_video_url = trim($custom["slider_video_url"][0]);
if ($slider_video_url == '') {
?>
<li>
<a href="<?php echo $slider_website_url; ?>"><img src="<?php echo $slider_image; ?>" alt="1" /></a>
<?php echo $slider_description_output; ?>
</li>
<?php
} else {
?>
<li>
<div class="video-container"><iframe id="player" src="<?php echo $slider_video_url; ?>" frameborder="0"></iframe>
<?php echo $slider_description_output; ?></div>
</li>
<?php
}
endwhile;
endif; wp_reset_postdata();
?>
</ul>
</div><!-- /End flexslider-->
</div><!-- /End slider_home-->
</aside><!-- END: #slider_wrap -->
<section id="main-content">
<div class="center_wrap">
<?php while ( have_posts() ) : the_post(); ?>
<section id="content" class="container_shadow">
<header><h2><?php //get page section title
if (get_post_meta($post->ID, $shortname.'_title_bar',true)) {
echo get_post_meta($post->ID, $shortname.'_title_bar',true);
} else {
echo $post->post_title;
}
?></h2></header>
<?php the_content(); ?>
<?php endwhile; wp_reset_postdata(); ?>
</section>
<section id="sidebar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Page Sidebar") ) : ?>
<?php endif; ?>
</section>
</div>
</section><!-- END: #main-content -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment