get next/prev only parent posts

how should I get only parent posts of custom post type projects prev/next posts (good would be if possible to make it recursively)

for example I have 3 parent posts and some with childs

post 1 
    child 1
    child 2
post 2
    child 3
    child 4
    child 5
post 3

and i want that all 3 (maybe more) posts would be turning recursively

PS. I have current post ID, if it helps

Read more here: get next/prev only parent posts

Leave a Reply

Your email address will not be published. Required fields are marked *