Support » Plugin: A-Z Listing » Show main pages, but hide their child pages

  • Hi,
    First of all, this plugin is pretty awesome! Congrats.
    However, I have a problem.
    I want to show pages, but I don’t want to show their child pages. If I use [a-z-listing post-type=”page”] , all the child pages are shown.

    Please, help me! Thank you very much!

Viewing 1 replies (of 1 total)
  • Plugin Author Daniel Llewellyn

    (@diddledan)

    Hi,

    To show only some pages, they need a common parent page to use as a selector. If we consider the parent page ID is 42, you can do something like:

    [a-z-listing display="posts" post-type="page" parent-post="42" get-all-children="no"]
    

    If your pages don’t currently have a common parent but are “top-level” you will either need to create a new page to be their parent or if you have a “home” page then you can make that the parent of your pages and select that ID.

    An alternative to using a parent page is to add a taxonomy term to each page you want in the listing and select on that instead. WordPress does not assign any taxonomies to the page post-type by default, so you will need to either add a plugin that allows you to configure one or add some PHP code to create/assign a taxonomy to the page post-type. Let’s consider you configured the “tags” taxonomy to be used with pages and added a tag called “include-in-az” then you can try something like:

    [a-z-listing display="posts" post-type="page" taxonomy="post_tag" terms="include-in-az"]
    
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.