Answer the question
In order to leave comments, you need to log in
Why is WP_Query ignoring categories?
I do a slug replacement in records through a selection
$query = new WP_Query(' posts_per_page=-1, cat=73,74 ');
posts_per_page=-1
normally selects all records, but it is cat
ignored so that I do not specify there. How to specify the categories correctly?
Answer the question
In order to leave comments, you need to log in
As I understand it, your syntax is wrong. it should be something like this
$query = new WP_Query(' posts_per_page=-1&cat=73,74 ');
$query = new WP_Query( array( 'posts_per_page' => '-1', 'cat' => '73,74' ) );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question