Hello
I have that uploaded structure.
I need to display a view inside both parent and child post which display links for all languages. I read the documentation about many to many relationship but it won't work for me.
For example if I browse "Child Post 2" I need to display these link inside the post:
<a href="link-to-parent-post">english</>
<a href="link-to-child-post-1">russian</>
<a href="link-to-child-post-2">spanish</>
<a href="link-to-child-post-3">arabic</>
Any help will be appreciated.
Thanks
Hello,
It is possible with Views plugin, and in your case, it just need one hierarchical post type
For example:
1) Create a post type "my-cpt", enable below two options:
- Hierarchical
- Page Attributes
So you will get a post type just like WordPress built-in post type "Pages"
More help:
https://developer.wordpress.org/reference/functions/register_post_type/
'hierarchical'
(bool) Whether the post type is hierarchical (e.g. page). Default false.
2) Create/edit each "my-cpt" post, setup the posts hierarchical relationship
- parent-post
---- child-post-1
---- child-post-2
...
3) In single "Child Post 2" post, follow our document to display it's Brother posts:
https://toolset.com/documentation/user-guides/views/displaying-brother-pages/
Displaying Brother Pages