Problems with display-posts shortcode

  • Unknown's avatar

    So there’s a drop-down in front of the ‘start a new forum thread’ asks me to ‘select the blog you need help with’ but it lacks none of the blogs I actually have on wordpress.com, you know, the ones that are supposed to be tied to this account? No idea what’s up with that.

    Here’s the blog post I’m having trouble with:

    https://ageofvictory.wordpress.com/world/

    The short code I have in that is:

    [display-posts post_type="page" post_parent="world"]

    My understanding is that it SHOULD list the posts that are children of the page ‘world’ but instead it lists only those posts of the type ‘page’ that aren’t children of the page ‘world’. And it excludes those pages that ARE children of the page ‘world’.

    My goal, I hope it’s clear, is to have only pages that are children of the page ‘world’ to show up.

    What am I doing wrong?

  • Unknown's avatar

    So if I do this:

    [display-posts post_type="page"]

    it lists all posts of type ‘page’

    but if I do this:

    [display-posts post_type="page" post_parent="world"]

    then it lists all posts of type ‘page’ EXCEPT the ones that have ‘world’ as their parent.

    the documentation says that post_parent is supposed to: “Display the pages that are a child of a certain page.” but it looks like it’s doing the opposite – maybe it’s inverted?

  • Unknown's avatar

    update: using post_parent=”current” (also acceptable in the documentation) gives a blank page.

    I see someone added modlook to this topic. Hopefully, some mod will be able to help.

    going to revert to what the doucmentation SAYS it should be, which is this:

    [display-posts post_type="page" post_parent="world"]

  • Hi @pangledon, we can dig into that a bit. We do have a much simpler shortcode for you to use in this case, though. How about [child-pages] ?

  • Unknown's avatar

    That worked!

    but do look into the way display-posts is working, as it’s counter to the documentation. Might need to fix the documentation?

  • Yup, we’ll be investigating. :) Cheers!

  • The topic ‘Problems with display-posts shortcode’ is closed to new replies.