Support

Account

Home Forums Front-end Issues Displaying Sibling ACF Fields Reply To: Displaying Sibling ACF Fields

  • I can’t give you exact code because I don’t have any handy.

    How you would get a list of sibling pages would depend. I’m not sure by reading your question if you are currently displaying the parent page or one of the other siblings.

    If you are displaying the parent page then what you need to do is do a WP_Query to get all of the child pages of the current page using the post_parent parameter https://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters.

    If you are showing one of the sibling pages already then the first thing you need to do is to get the parent id of the current post https://codex.wordpress.org/Function_Reference/wp_get_post_parent_id and then use this value when doing the query I mentioned above.