I do not fulfill the condition for the appearance of the button below, what do I do wrong?
<?php
query_posts( array(
'post_type' => 'post',
'post_per_page' => 6,
) );
if( have_posts() ){
while( have_posts() ){
the_post();
?>
<div class="project">
<a href="<?php echo get_permalink(); ?>"><div class="project-img" style="background: url('<?php echo get_the_post_thumbnail_url(); ?>')"></div></a>
<span><?php the_title(); ?></span>
<?php the_excerpt(); ?>
<p class="post-date"><?php the_date('d/m/Y'); ?></p>
</div>
<?php
}
} else {
}
?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<script>
var ajaxurl = '<?php echo site_url() ?>/wp-admin/admin-ajax.php';
var true_posts = '<?php echo serialize($wp_query->query_vars); ?>';
var current_page = <?php echo (get_query_var('paged')) ? get_query_var('paged') : 1; ?>;
var max_pages = '<?php echo $wp_query->max_num_pages; ?>';
</script>
<div id="true_loadmore">Загрузить ещё</div>
query_posts