Note that there are some explanatory texts on larger screens.

plurals
  1. POWordpress - List a specific page and sub pages from a page template or make a new menu?
    primarykey
    data
    text
    <p>Hi I have been trying for hours to display a four column grid of specific pages and their children on my page template. My site structure is:</p> <pre><code> Main Page Service Page -Service Type 1 --Service Type 1, Item 1 --Service Type 1, Item 2 -Service Type 2 --Service Type 2, Item 1 --Service Type 2, Item 2 </code></pre> <p>I am having difficulty trying to list my "Service Types" and there sub pages from my page template.</p> <p>I was trying to make an array of page ids (Ids from the "Service Types") and display the titles of these pages.</p> <p>Then I want to search the array and see if the pages in it have children and if so display the child titles underneath as links (following my css).</p> <p>It doesn't sound to difficult but I can't seem to get my head around it. I have been mashing code together but cant figure it out.</p> <p>I can display the pages in a basic list using: </p> <pre><code>&lt;?php wp_list_pages('include=453&amp;title_li='); ?&gt; &lt;?php wp_list_pages('child_of=453&amp;sort_column=post_title&amp;title_li=') ?&gt; &lt;?php wp_list_pages('include=457&amp;title_li='); ?&gt; &lt;?php wp_list_pages('child_of=457&amp;sort_column=post_title&amp;title_li=') ?&gt; </code></pre> <p>But would like to have something more dynamic so if I add more service types I dont have to manually enter all the code, instead I could populate the array with a new id?</p> <p>I want the top grid of my page to have something like:</p> <pre><code> -Service Type 1 -Service Type 2 -Service Type 3 --Service Type 1, Item 1 --Service Type 2, Item 1 --Service Type 3, Item 1 --Service Type 1, Item 2 --Service Type 2, Item 2 --Service Type 3, Item 1 </code></pre> <p>Am I approaching this right or should I make some sort of menu? Any help with this would be greatly appreciated!</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload