query problem for display with pagination

I developed a wordpress page template (which is supposed to display digital products that I sell on my site) that worked without problems for months, but since yesterday, the page template doesn’t show anything, not even the login bar of the site, I don’t understand why, the problem most certainly comes from the request, can you help me? Thank you for your answers

here is my code:

<?php // Template Name: edition ?>

<?php get_header(); ?>

<div id=”cultura” class=”cf”>

<div class=”avrbreadcrumb2″>
<?php
if(function_exists(‘get_hansel_and_gretel_breadcrumbs’)):
echo get_hansel_and_gretel_breadcrumbs();
endif;
?>
</div>

<?php
if (get_query_var(‘paged’)) {
$paged = get_query_var(‘paged’);
} elseif (get_query_var(‘page’)) { // ‘page’ is used instead of ‘paged’ on Static Front Page
$paged = get_query_var(‘page’);
} else {
$paged = 1;
}
$args = array(
‘post_type’ => ‘edition_newstrotteur’,
‘numberposts’ => -1,
‘post_status’ => null,
‘post_parent’ => null,
‘posts_per_page’ => 9,
‘paged’ => $paged //very important
);

// The Loop
$custom_query = new WP_Query($args);
if ($custom_query->have_posts()) : ?>

<nav class=”herdewebnav2″>
<?php echo pagination($custom_query->max_num_pages); ?>
</nav>
<?php
while ($custom_query->have_posts()) : $custom_query->the_post();
?>

<li class=”grid-item2″>
<div class=”classlecture”>
<?php the_post_thumbnail(‘large’); ?>
</div>
<div class=”globalfields”>

<a href=”<?php echo get_permalink($post->ID);?>” >
<h1>
<?php echo wp_trim_words( get_the_title(), 10 ); ?>
</h1>
</a>

<div class=”deletereadmore”>
<p class=”paranews”>
<?php echo substr(get_the_excerpt(), 0, 85); ?>…
</p>
</div>
<div class=”globalamz”>
<div class=”flexamz”>
<a class=”read-more3″ href=”<?php the_permalink(); ?>” >
Lire plus
</a>
<strong class=”read-more3″>
<?php echo get_post_meta($post->ID, ‘link_amz’, true);?>
</strong>
</div>
</div>
</div>
</li>

<?php endwhile; ?>

<nav class=”herdewebnav2″>
<?php if (function_exists(“pagination”)) {
pagination($custom_query->max_num_pages);
} ?>
</nav>
</ul>

<?php endif;
wp_reset_postdata();

?>

</div>

<?php get_footer(); ?>

Read more here:: query problem for display with pagination

Leave a Reply

Your email address will not be published. Required fields are marked *