Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save farik92/b69ff39e498af369c067c81b551adfb8 to your computer and use it in GitHub Desktop.

Select an option

Save farik92/b69ff39e498af369c067c81b551adfb8 to your computer and use it in GitHub Desktop.
<?php
$do_not_duplicate = array();
$args = array(
'type' => 'work',
'orderby' => 'name',
'order' => 'ASC',
'taxonomy' => 'worktype'
);
$categories = get_categories( $args );
foreach( $categories as $category ) {
$args = array(
'posts_per_page' => 1,
'post_type' => 'work',
'worktype' => $category->slug,
'no_found_rows' => true,
'update_post_meta_cache' => false,
'update_post_term_cache' => false
);
$the_query = new WP_Query( $args );
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
<div class="work_row row">
<div class="work_col__image col-lg-5 col-12">
<?php the_post_thumbnail(); ?>
</div>
<div class="col-lg-7 col-12">
<div class="work_col__wrapper">
<div class="work_col__wrap">
<div class="work_col__iner">
<img src="http://wwwbin/wp-content/themes/ooobin/img/home/trungl-yllow.png" alt="">
<h2><?php the_title(); ?></h2>
</div>
<p class="work_col__span"><?php echo $wsubtitle; ?></p>
<p class="work_col__text"><?php echo $wsubtitletext; ?></p>
</div>
<div class="work_column">
<h2 class="work_column__title"><?php echo $wdestitle; ?></h2>
<p class="work_column__text"><?php the_content(); ?></p>
</div>
</div>
</div>
</div>
</div>
<?php endwhile;
}
wp_reset_postdata();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment