Created
March 27, 2017 15:49
-
-
Save davidtrushkov/fc540973dfcda069f3502a93908ef17d to your computer and use it in GitHub Desktop.
Revisions
-
davidtrushkov created this gist
Mar 27, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ <div class="container-fluid no-padding hidden-xs"> <?php foreach (get_posts(['post_type' => 'home_project_section', 'posts_per_page'=>100]) as $key => $homeProjects) { $thumb_id = get_post_thumbnail_id($homeProjects); $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true); $thumb_url = $thumb_url_array[0]; $website_url = '/projects/'; $url_to_project = $website_url . $homeProjects->post_name; ?> <?php if($key % 2 == 0) { ?> <div class="col-xs-12 no-padding"> <div class="col-sm-7 col-md-6 home-projects-project-container"> <h1 class="home-projects-header"> <?= $homeProjects->post_title ?> </h1> <p class="home-projects-description"> <?= $homeProjects->post_content ?> </p> <br /> <a href="<?= $url_to_project; ?>" class="btn btn-primary btn-light-blue"> View Case Study </a> </div> <div class="col-sm-5 col-md-6 no-padding"> <div style="background: url('<?= $thumb_url; ?>') center center; background-size: cover;" class="home-projects-image"></div> </div> </div> <?php } else { ?> <div class="col-xs-12 no-padding"> <div class="col-sm-5 col-md-6 no-padding"> <div style="background: url('<?= $thumb_url; ?>') center center; background-size: cover;" class="home-projects-image"></div> </div> <div class="col-sm-7 col-md-6 home-projects-project-container"> <h1 class="home-projects-header"> <?= $homeProjects->post_title ?> </h1> <p class="home-projects-description"> <?= $homeProjects->post_content ?> </p> <br /> <a href="<?= $url_to_project; ?>" class="btn btn-primary btn-light-blue"> View Case Study </a> </div> </div> <?php } ?> <?php } ?> </div>