Skip to content

Instantly share code, notes, and snippets.

Created August 28, 2014 12:39
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 anonymous/11fd138135334258fc1a to your computer and use it in GitHub Desktop.
Save anonymous/11fd138135334258fc1a to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<?php
require_once(CLASS_PATH.'/com/sakurapixel/php/post_options.php');
require_once(CLASS_PATH.'/com/sakurapixel/php/SkHelper.php');
require_once(CLASS_PATH.'/com/sakurapixel/php/theme_options.php');
require_once(CLASS_PATH.'/com/sakurapixel/php/libs/sk_resizer.php');
$skThemeOptions = new SKThemeOptions();
$post_options = new PostOptions($post);
$post_settings = $post_options->getPostExtraSettings();
$featuredImages = $post_options->getFeaturedImages(870, $post_settings['post_images_height']);
$isFeaturedVideo = $post_options->isFeaturedVideo();
$theme_options = new SKThemeOptions();
$website_colors = $theme_options->getWebsiteColors();
$sk_helper = new SkHelper();
$overlayRGBA = $sk_helper->html2rgb($website_colors['lagunaBlue']);
$is_blog_social = $theme_options->isBlogSocial();
$isBlogComments = $theme_options->isBlogComments();
$showRelatedBlogPosts = $theme_options->showRelatedBlogPosts();
$relatedBlogPostsMaxNo = $theme_options->getMaxRelatedPosts();
?>
<div class="row">
<!--left side-->
<div class="span9">
<!--page title template-->
<?php get_template_part('templates/page_single_title_template');?>
<!--/page title template-->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!--featured-->
<div class="postFeaturedUI">
<?php if(($featuredImages)&&!$isFeaturedVideo):?>
<?php
$sk_helper = new SkHelper();
echo $sk_helper->getBootstrapCarousel($featuredImages);
?>
<?php endif; ?>
<?php if($isFeaturedVideo):?>
<?php
echo $post_options->getVideoCode();
?>
<?php endif; ?>
</div>
<!--/featured-->
<!--the content-->
<div class="defaultText fontStyle3" style="color: #<?php echo $website_colors['blueGrey'];?>;" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php the_content();?>
</div>
<!--/the content-->
<div class="clear-fx"></div>
<?php endwhile; else: ?>
<p><?php _e('No posts were found. Sorry!', 'default_textdomain'); ?></p>
<?php endif; wp_reset_query();?>
<div class="row-fluid single_tags">
<?php get_template_part( 'templates/post_tags'); ?>
<div class="span6">
<?php if($is_blog_social):?>
<?php get_template_part( 'templates/social_template'); ?>
<?php endif;?>
</div>
</div>
<!--related posts-->
<?php if($showRelatedBlogPosts):?>
<p class="replay-title"><?php _e('Related projects', 'default_textdomain');?></p>
<div class="hline comments_underline"></div>
<!--slider-->
<div class="skHSlider">
<div class="skHsliderMainContent">
<div class="sliderHMask">
<div class="sliderHList">
<!--slider items-->
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'showposts'=>$relatedBlogPostsMaxNo, // Number of related posts that will be shown.
'ignore_sticky_posts'=>1
);
$my_query = new wp_query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) {
$my_query->the_post();
$p_thumb = 'none';
if(has_post_thumbnail($post->ID)){
$res = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
if($res){
$thumb_temp_url = sk_resize($res[0], 265, 168, true);
$p_thumb = ($thumb_temp_url)?$thumb_temp_url:$p_thumb;
}
}
$permalink = get_permalink($post->ID);
?>
<?php if($p_thumb!='none'):?>
<div class="sliderHItem pFeaturedImageUI">
<a href="<?php echo $permalink;?>" title=""><img src="<?php echo $p_thumb;?>" alt="" /></a>
<!--overlay-->
<div class="pItemOverlayContainer" style="background-color: #<?php echo $website_colors['lagunaBlue'];?>; background: rgba(<?php echo $overlayRGBA[0];?>,<?php echo $overlayRGBA[1];?>,<?php echo $overlayRGBA[2];?>,.1);">
<div class="beaconPortfolio genericBeacon" data-href="<?php echo $permalink;?>">
<div class="beaconCircle1"></div>
<div class="beaconCircle2">
<img src="<?php echo IMAGES.'/link_icon_beacon.png';?>" alt="" />
</div>
</div>
</div>
<!--/overlay-->
</div>
<?php endif;?>
<?php
}
}
}
?>
<?php wp_reset_query();?>
<!--/slider items-->
</div>
<div class="clear-fx"></div>
</div>
</div>
<div class="skHsliderControl skHsliderLeft">
<a class="sliderHNav metroItem" data-secondaryColor="<?php echo $skThemeOptions->getMetroColor($website_colors['lagunaBlue'], false);?>"><img src="<?php echo IMAGES.'/h_slider_arrow_left.png';?>" alt="" /></a>
</div>
<div class="skHsliderControl skHsliderRight">
<a class="sliderHNav metroItem" data-secondaryColor="<?php echo $skThemeOptions->getMetroColor($website_colors['lagunaBlue'], false);?>"><img src="<?php echo IMAGES.'/h_slider_arrow_right.png';?>" alt="" /></a>
<div class="clear-fx"></div>
</div>
</div>
<!--/slider-->
<?php endif;?>
<!--/related posts-->
<!--comments-->
<?php if($isBlogComments):?>
<div class="comments_top_space"></div>
<div><?php comments_template(); ?></div>
<?php endif;?>
<!--/comments-->
</div>
<!--/left side-->
<!--right side - sidebar-->
<div class="span3">
<div class="spaceTitleTop"></div>
<?php
require_once(CLASS_PATH.'/com/sakurapixel/php/sidebars/SidebarManager.php');
get_sidebar(SidebarManager::getInstance()->getSidebarFILE('sk-blog-single-sidebar'));
?>
</div>
<!--/right side - sidebar-->
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment