-
-
Save szbl/3650545 to your computer and use it in GitHub Desktop.
This file contains 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
<!-- Highlighted Providers --> | |
<div id="content" class="clearfix"> | |
<h1>Highlighted Providers</h1> | |
<ul class="hlprovide clearfix"> | |
<?php | |
// Set the page to be pagination | |
$paged = get_query_var('paged') ? get_query_var('paged') : 1; | |
// Query Out Database | |
$wpbp = new WP_Query(array( | |
'post_type' => 'provider', | |
'posts_per_page' =>'4', | |
'paged' => $paged, | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'post_tag', | |
'field' => 'slug', | |
'terms' => array( 'highlighted' ) | |
) | |
) | |
)); | |
?> | |
<?php | |
// Begin The Loop | |
if ($wpbp->have_posts()) : while ($wpbp->have_posts()) : $wpbp->the_post(); | |
?> | |
<?php | |
$large_image = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'fullsize', false, '' ); | |
$large_image = $large_image[0]; | |
?> | |
<?php | |
//Apply a data-id for unique indentity, | |
//and loop through the taxonomy and assign the terms to the portfolio item to a data-type, | |
// which will be referenced for Quicksand Script | |
?> | |
<li> | |
<?php | |
// Check if wordpress supports featured images, and if so output the thumbnail | |
if ( (function_exists('has_post_thumbnail')) && (has_post_thumbnail()) ) : | |
?> | |
<?php // Output the featured image ?> | |
<a rel="prettyPhoto[gallery]" href="<?php echo the_permalink(); ?>"><?php the_post_thumbnail('provider'); ?></a> | |
<?php endif; ?> | |
<?php // Output the title of each portfolio item ?> | |
<p><a href="<?php the_permalink(); ?>"><?php echo get_the_title(); ?></a></p> | |
</li> | |
<?php $count++; // Increase the count by 1 ?> | |
<?php endwhile; endif; // END the Wordpress Loop ?> | |
<?php wp_reset_query(); // Reset the Query Loop ?> | |
</ul> | |
<?php | |
if(function_exists('wp_pagenavi')) | |
{ | |
wp_pagenavi(array( 'query' => $wpbp ) ); | |
wp_reset_postdata(); // avoid errors further down the page | |
} | |
?> | |
</div><!-- End Highlighted Providers --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment