• For a home page I am trying to implement a carousel that shows the post_thumbs of several grandchild-pages. These grandchild-pages belong to a total of 6 parent pages and these have 1 grandparent.
    I do not want to show the thumbnail of the grandparent nor of any of the other pages (siblings of the grandparent).

    I have tried to run a query as shown in the codex (https://codex.www.ads-software.com/Template_Tags/query_posts#Post_.26_Page_Parameters) using ‘post_parent’ => array(51,53,54,55,56,57) , but if I do that it shows a whole bunch of other pages too.

    I got it working now by also using ‘post__not_in’ => array(), but obviously that is not the best solution as every time a new page gets added, I have to go back to that file…

    I don’t know if it helps, but I am also using these parameters in the same query:
    ‘post_type’=> ‘page’,
    ‘posts_per_page’ => -1,
    ‘orderby’=> ‘menu_order’,
    ‘order’=> ‘ASC’,

    What am I doing wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have you looked at using get_children?

    Thread Starter Pieter Bos

    (@senlin)

    that sounds interesting @esmi, thanks!

    not entirely sure though how to wrap that in the query as the get_children() page basically refers to the get_posts() page and while I am looking now at “show all attachments” I see a bit too many variables there that I would not need.

    I would only need the thumbnail to show for which I already added support in my functions.php file.

    Would you be able to help me a bit more on my way?

    Thanks so much already for pointing me in the right direction!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP Query close, but no cigar!’ is closed to new replies.