Sublevel landing page – gallery menu of pages
-
I thought this might help somebody as it took me a while to figure out. Suggestions on how to improve the code would be welcome.
—————-
Have you ever wanted to create a sublevel landing page that displays a gallery menu of its child pages as well as a few other arbitrary pages that you specify? This code will output the thumbnail as link, title as a link and short description text, arranged in 4 columns.Instructions:
- Create a page template using the code below.
- Create a page using the template
- If required, add a custom field to your page called “include_pages” where you can list some extra page IDs you would like to output.
- In each page that you intend to output, create a custom field called “page-desc” and add some short introduction text.
- Create css styles for “gallery” to size and wrap the list, “image-wrap” to size the image, “four_columns” to size the columns, “excerpt”, “h2” and “nomargin” for the final item.
Other ideas:
You could amend the template to exclude certain child pages by creating an “exclude_pages” custom field and extracting those values from the merged pages array.[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
- The topic ‘Sublevel landing page – gallery menu of pages’ is closed to new replies.