Skip to content

Instantly share code, notes, and snippets.

@deepak125
Created March 31, 2017 01:12
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 deepak125/359096db3956fd4592c7dbace323cb13 to your computer and use it in GitHub Desktop.
Save deepak125/359096db3956fd4592c7dbace323cb13 to your computer and use it in GitHub Desktop.
<?php
$startup_loop = new WP_Query(
array(
'post_type' => 'startup',
'facetwp' => true,
'orderby' => array(
'meta_value_num' => 'DESC',
'post_date' => 'ASC',
),
)
);
if ($startup_loop->have_posts()) {
?>
<section class="section">
<div class="container">
<header class="filter-header">
<div class="col-sm-4">
<h4>All Startups</h4>
</div>
<div class="col-sm-8">
<div class="filterWrap">
<span>CLASS</span>
<?php echo facetwp_display( 'facet', 'industries' ); ?>
</div>
</div>
</header>
<div id="gallery-section" class="facetwp-template">
<?php
while ($startup_loop->have_posts()) {
$startup_loop->the_post();
$picture_size = get_field('picture_size');
if (!$picture_size)
$picture_size = 'post-portrate';
$class = wp_get_post_terms(get_the_ID(), 'sclass');
?>
<?php if (has_post_thumbnail()) { ?>
<div class="mix">
<a href="javascript:void(0);" data-toggle="modal" data-target="#class_<?php echo get_the_ID() ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
<!-- Modal -->
<div class="modal fade" id="class_<?php echo get_the_ID() ?>" tabindex="-1" role="dialog" aria-labelledby="class1">
<div class="modal-dialog" role="document">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<div class="modal-body">
<header>
<figure>
<?php the_post_thumbnail('medium_large'); ?>
</figure>
<figcaption>
<h4><?php the_title() ?></h4>
<span class="classname">Class: <?php echo $class[0]->name ?></span>
</figcaption>
</header>
<?php the_content() ?>
<a href="<?php the_field('website') ?>" class="btn btn-lg btn-primary">GO TO <?php the_field('website') ?></a>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</section>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment