Skip to content

Instantly share code, notes, and snippets.

@Avakulenko
Created December 22, 2015 15:07
Show Gist options
  • Select an option

  • Save Avakulenko/e865258e4bccb25fa76a to your computer and use it in GitHub Desktop.

Select an option

Save Avakulenko/e865258e4bccb25fa76a to your computer and use it in GitHub Desktop.
<?php
/*
Template Name: Home
*/
get_header(); ?>
<?php if (have_posts()): ?>
<?php while (have_posts()): the_post(); ?>
<?php
$home_slides = carbon_get_the_post_meta('crb_home_slides', 'complex');
if ($home_slides): ?>
<div class="slider">
<div class="slider-clip">
<ul class="slides">
<?php
foreach ($home_slides as $slide) {
echo wp_get_attachment_image($slide['image'], 'home-slider');
}
?>
</ul><!-- /.slides -->
</div><!-- /.slider-clip -->
</div><!-- /.slider -->
<?php endif ?>
<?php
$home_features = carbon_get_the_post_meta('crb_home_features', 'complex');
if ($home_features): ?>
<section class="section-primary">
<div class="shell">
<ul class="list-features">
<?php foreach ($home_features as $feature): ?>
<li>
<a href="<?php echo esc_url($feature['link']); ?>">
<span>
<?php echo wp_get_attachment_image($fea , ''); ?>
</span>
<?php if ($feature['label']): ?>
<strong><?php echo $feature['label']; ?></strong>
<?php endif ?>
</a>
</li>
<?php endforeach ?>
</ul><!-- /.list-features -->
</div><!-- /.shell -->
</section><!-- /.section-primary -->
<?php endif ?>
<?php endwhile ?>
<?php endif ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment