M
M
megamutex2016-01-15 10:09:43
PHP
megamutex, 2016-01-15 10:09:43

Display posts of a certain wordpress level?

There are posts of the following structure:
JgHf2QS.png
Question: how to display records of only the 3rd level, if we are on the page of the 1st level. If there were only 2 levels, I would get the id of the current page and add with args array 'post_parent' => $id_текущей_страницы, and all child records would be displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WP Panda, 2016-01-15
@megamutex

'post_parent__not_in' => array(0,$id_текущей_страницы)

UPD
did not read the question correctly, do it in 2 cycles, get the 2nd level of the current one first, collect their id d array and then
'post_parent__in' => $_полученный массив

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question