L
L
ligisayan2016-05-30 17:24:02
HTML
ligisayan, 2016-05-30 17:24:02

Why isn't the entire selection of the loop being output?

Hello! There is a site on wordpress + woocommerce. Installed the Woo Gift : Advanced Woocommerce Gift Plugin plugin and faced this issue. In a request from the product database

$args_post = array('post_type' => 'product','posts_per_page'=>-1);
$loop_post = new WP_Query( $args_post );

directive output of all elements 'posts_per_page'=>-1 kills the subsequent output of the plugin. If instead of -1 you assign 50 or 100, for example, then everything will be displayed ok, but a limited number.
How to display exactly all the elements of the selection?
ps it is interesting that on the mirror on another hosting everything is ok and with -1. . Could this be a hosting issue?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
ligisayan, 2016-05-31
@ligisayan

Thank you all for your help! The error was in the plugin itself - the bracket was closed in the wrong place in the loop, but in another file

M
Mr Crabbz, 2016-05-30
@Punkie

<pre>
print_r($loop_post);
</pre>

do. Look at what the cycle returns there and with what parameters are stored in the object.

P
Puma Thailand, 2016-05-30
@opium

no permission to create file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question