• I have set up page hierarchy as follows:

    Topics (main page)
      |___ Topic A  (page)
      |___ Topic B  (page)
      |___ Topic C  (page)
      |___ Topic n...  (page)

    I’d like to have a grid that auto-populates with any sub-page whose parent page is “Topics”.

    I’ve tried using a few plugins but I can’t get them to show all those sub-pages. Is there any way to achieve this? I’d like for the grid to show the Featured Image with the page title in each grid square, with the title and graphic hyperlinked to the respective sub-page.

    Oh… and it should display as many sub-pages as possible… e.g. 200, by a title sort order, and thereafter have the ability for pagination.

    Thank you.

    • This topic was modified 3 years, 8 months ago by veedot2.
    • This topic was modified 3 years, 8 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It could be accomplished with a custom query made from a template dedicated for the purpose. Name this template according to template hierarchy so it can be used as response only to a specific request. Keep such templates in a child theme if your principal theme is subject to periodic updates.

    Use the 'post_parent' arg of WP_Query or get_posts() to get all child posts. Loop through the results as usual to output desired HTML. Appearance as a grid is a matter of applying proper CSS. If you want a huge number of posts listed on a page, you might consider some sort of lazy loading or infinite scroll scheme so users can see the initial above the fold view sooner.

Viewing 1 replies (of 1 total)
  • The topic ‘How to display subcategory pages in a grid?’ is closed to new replies.