I created a separate record type, put 10 records there. But only the first 5 of them are displayed. Moreover, the problem is not in specific records, since I deleted them and created them to change the order of specific records. Only the 5 oldest records are always displayed. Here is the code for this entry from function.php

function getReviews(){ $args = array( 'orderby' => 'date', 'order' => 'ASC', 'post_type' => 'reviews' ); $reviews = []; foreach (get_posts($args) as $post) { $review = get_fields($post->ID); $rwview['client_name_and_age'] = $post->post_title; $review['text'] = $post->post_content; $review['title'] = $post->post_title; $review['img'] = get_the_post_thumbnail_url($post->ID, 'thumbnail'); $reviews[] = $review; } return $reviews; } 

Here is how I display entries in the layout: enter image description here

enter image description here

Additional fields created using the Advanced Custom Fields plugin

If you need any additional information - let me know.

    2 answers 2

     $args = array( 'orderby' => 'date', 'order' => 'ASC', 'post_type' => 'reviews', 'posts_per_page' => -1 - (ко-во постов на странице, -1 - все посты) ); 

      get_posts() has predefined parameters, including numberposts=5 .

      Add to args

       numberposts=-1