Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
<!-- Highlighted Providers -->
<div id="content" class="clearfix">
<h1>Highlighted Providers</h1>
<ul class="hlprovide clearfix">
// 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) );
// Begin The Loop
if ($wpbp->have_posts()) : while ($wpbp->have_posts()) : $wpbp->the_post();
$large_image = wp_get_attachment_image_src( get_post_thumbnail_id(get_the_ID()), 'fullsize', false, '' );
$large_image = $large_image[0];
//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
// 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>
<?php $count++; // Increase the count by 1 ?>
<?php endwhile; endif; // END the Wordpress Loop ?>
<?php wp_reset_query(); // Reset the Query Loop ?>
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
You can’t perform that action at this time.