Is there any documentation that you are following? I didn't found a document for the legacy view creation anymore.
The second question is, how do I set this view, to get infinite scrolling pagination? So that it shows first 6 related posts, and then when the customer is scrolling down, it will showing all the times 3 more.
Is there a similar example that we can see? hidden link
Thank you for getting in touch. But we like to get it "dynamically"... - so is it possible to have a shortcode instead of a fixed number? Something like this:
This is exactly the way to do it, given that you want to dynamically get the parent ID of the current post. However I would format it a little different so that the quotations don't get closed early. Use the one below.
Notice the use of the double quotes. The second question is, how do I set this view, to get infinite scrolling pagination? So that it shows first 6 related posts, and then when the customer is scrolling down, it will showing all the times 3 more.
When you are doing the pagination there is a fixed number of items per page. What this means is that you won't be able to start your view with 6 posts and then paginate by 3 posts. If the view is started with 6 posts then the pagination will bring the next 6 posts when scrolling down.
To enable the infinite scroll pagination, you will need to first edit your view then scroll to the "Pagination and Sliders Settings" if you're not seeing this scroll to the top of the edit screen and click screen options in the top right then enable it there.
Now once the section is enabled select "Pagination enabled with manual transition and AJAX" under "Transition effect: " select Infinite Scroll.
About the first part - is there another way to do it? Somehow the theme we use isn't 100% compatible, and having some small issues with show everything correct:
I know that for some theme or page builders when using their shortcode editor you will get a broken "] at the end because they aren't compatible with nested shortcodes.
Secondly you should just be able to return the do_shortcode() function.