Created
February 28, 2018 16:39
-
-
Save gjreasoner/235cf7db45ad70ddd4b06a01300b62d0 to your computer and use it in GitHub Desktop.
Raw file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php /* Template Name: Portfolio */ ?> | |
<?php get_header(); ?> | |
<?php | |
$thumb_id = get_post_thumbnail_id(); | |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true); | |
$thumb_url = $thumb_url_array[0]; | |
if( have_posts() ){ | |
while( have_posts() ){ | |
the_post(); | |
?> | |
<?php { if ( is_front_page() ) { get_template_part('sections/default'); } } ?> | |
<div id="PORTFOLIO-PAGE"> | |
<section id="welcome" class="hero default portfolio-hero" style="background: url('<?=get_field_object('portfolio_background_image')['value'];?>') center bottom; background-size: cover;"> | |
</section> | |
<section id="PORTFOLIO-DESCRIPTION-CONTAINER"> | |
<div class="container"> | |
<h4><?=get_field_object('portfolio_description_sub_header')['value'];?></h4> | |
<h2><?=get_field_object('portfolio_description_main_header')['value'];?></h2> | |
<p><?=get_field_object('portfolio_description')['value'];?></p> | |
</div> | |
</section> | |
</div> | |
<div class="container-fluid no-padding-xs hidden-xs visible-lg-screens"> | |
<div class="masonry-3 gutterless"> | |
<?php include('wp-content/themes/integral-child/sections/grid-project.php'); ?> | |
</div> | |
</div> | |
<div class="container-fluid no-padding hidden-xs hidden-lg-screens"> | |
<div class="masonry-3 gutterless"> | |
<?php include('wp-content/themes/integral-child/sections/grid-project.php'); ?> | |
</div> | |
</div> | |
<section id="our-work" class="visible-xs"> | |
<div class="container-fluid no-padding"> | |
<div class="col-sm-12 no-padding"> | |
<?php foreach (get_posts(['post_type' => 'portfolio_item', 'posts_per_page' => 100]) as $key => $portfolio_items) { | |
$thumb_id = get_post_thumbnail_id($portfolio_items); | |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true); | |
$thumb_url = $thumb_url_array[0]; | |
$url_to_project = "/help-article/".$portfolio_items->post_name; | |
?> | |
<a href="<?=get_field_object('link_to_page', $portfolio_items)['value'];?>"> | |
<div class="col-sm-3 portfolio-item-box-image" style="background: url('<?= $thumb_url; ?>') center top; background-size: cover;"></div> | |
</a> | |
<?php } ?> | |
</div> | |
</div> | |
</section> | |
<?php include('wp-content/themes/integral-child/sections/testimonials.php'); ?> | |
<?php include('wp-content/themes/integral-child/sections/quote.php'); ?> | |
<?php | |
} /* END PAGE */ | |
} | |
?> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment