I’m trying to display the recent download posts on my homepage. with WP_query.
But i don’t get any display or error.
WPDOWNLOADMANAGER is a download plugin that has it’s own category.
<?php
$args = array(
'post_per_page' => 1,
'post_type' => 'document',
'paged' => get_query_var('paged')
);
$homepage_query = new WP_Query($args);
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
?>
<?php if (have_posts() ) : while ($homepage_query->have_posts() ) : $homepage_query->the_post(); ?>
<div class="post-list-item">
<div class="row no-gutters">
<div class="col-lg-3 post-item-type">
<i class="fa fa-file-text-o"></i>
<a href="<?php the_permalink();?>"><button class="btn btn-green">View Document</button></a>
</div>
<div class="col-lg-9 post-item-panel">
<div class="post-title">
<span><?php the_title();?></span>
</div>
<div class="post-excerpt">
<p><?php echo substr(get_the_excerpt(), 0,160); printf( '<a class="read-more" href="%1$s">%2$s</a>', get_permalink( get_the_ID() ), __( ' ...Read More', 'textdomain' )
); ?></p>
</div>
</div><!--//post-item-panel-->
</div><!--row-no-gutters-->
</div><!--//post-list-item-->
<?php endwhile; endif; wp_reset_query(); ?>
<?php
if ( function_exists('wp_bootstrap_pagination') )
wp_bootstrap_pagination();
?>
ok. LOL got it all wrong again.