Betiok
6/14/2017 - 12:40 PM

Different loop args

Different loop args

<?php
	$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;

	$args = array(
		'post_type' => 'project',
		'posts_per_page' => 9,
		'paged' => $paged
	);

	$wp_query = new WP_Query($args);
?>

<div class="columns columns-3 infinite-scroll">
	<?php if ($wp_query->have_posts()): while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
		<article id="post-<?php the_ID(); ?>" <?php post_class('col'); ?>>
			<?php if ( has_post_thumbnail()) : ?>
				<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
					<div class="img-wrap">
						<?php the_post_thumbnail('medium'); ?>
					</div>
				</a>
			<?php endif; ?>

			<h3 class="title">
				<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
					<?php the_title(); ?>
				</a>
			</h3>
		</article>
	<?php endwhile; ?>

	<?php endif; ?>

	<?php get_template_part('pagination'); ?>

	<?php wp_reset_query(); ?>
</div>
<?php
	$terms = wp_get_post_terms($post->ID, 'project-category');

	echo $terms[0]->slug;
?>
$taxonomy = 'category';
$terms = get_the_terms($post->ID, $taxonomy);

$args = array(
	'post_type' => 'post',
	'posts_per_page'=> 2,
	'post__not_in' => array($post->ID),
	'order'=> 'DESC',
	'tax_query' => array(
		array(
			'taxonomy' => $taxonomy,
			'field'    => 'slug',
			'terms'    => $terms[0]->slug
		),
	)
);

$loop = new WP_Query($args);
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;

$args = array(
	'post_type' => 'project',
	'posts_per_page' => 6,
	'order' => 'DESC',
	'paged'=> $paged
);

$wp_query = new WP_Query($args);
$args = array(
	'post_type' => 'project',
	'posts_per_page' => -1,
	'order' => 'DESC',
	'meta_key' => 'project_featured',
	'meta_value' => 'no'
);
$terms = $wp_query->get_queried_object();

$args = array(
	'post_type' => 'products',
	'posts_per_page' => -1,
	'order' => 'DESC',
	'tax_query' => array(
		array(
			'taxonomy' => 'products-category',
			'field'    => 'slug',
			'terms'    => $terms->slug
		),
	)
);
<?php
	$taxonomy = 'collection-category';

	$terms = get_terms( array(
		'taxonomy' => $taxonomy,
		'hide_empty' => false,
	) );
?>

<?php foreach ($terms as $term) : ?>
	<?php $thumbnail = get_field('collection_category_thumbnail', $term->taxonomy . '_' . $term->term_id); ?>

	<article class="col collection-category">
		<a href="<?php echo esc_attr(get_term_link($term, $taxonomy)); ?>">
			<img src="<?php echo $thumbnail['sizes']['gallery-1']; ?>" alt="<?php echo $thumbnail['alt']; ?>" />

			<h4 class="title">
				<?php echo $term->name; ?>
			</h4>
		</a>
	</article>
<?php endforeach; ?>

<?php wp_reset_query(); ?>