enter image description here enter image description here

How to implement the "See More" button of the current category on a new page, and so on for all countries. Help, please, I can not, well, does not work. Thank you in advance.

<h1>SPA</h1> <?php global $wp_query; $query = new WP_Query( array_merge( array( 'post_type' => 'countries', 'tour-type' => 'spa' ), // это параметр который добавили мы $wp_query->query // это массив базового запроса текущей страницы ) ); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?> <a href="<?php the_permalink(); ?>"><h3><?php the_title(); ?></h3></a> <?php endwhile; endif; // Reset Post Data wp_reset_postdata(); ?> <?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> <?php endif; ?> 

  • According to the rules of the community, you need to give the code. - KAGG Design
  • Uh, wait, where are the js code and ajax? Load More buttons do just that. - KAGG Design
  • I would like to display on a new page is it possible so - WP_LOAD
  • Judging by the fact that I want on the main page of the country, for example, Italy displayed all categories of 4 articles (kitchen category = 4, nature category = 4, sightseeing category = 4) but when clicking on a category for example, nature displayed all the nature associated with this country, and so for all countries. Thanks for the response - WP_LOAD
  • Well, make the transition to another page, where the whole nature would be derived, say. If you want to refresh the page, read about ajax. - KAGG Design

0