[resolved] Sublevel landing page - gallery menu of pages (5 posts)

  1. La M
    Posted 4 years ago #

    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.


    1. Create a page template using the code below.
    2. Create a page using the template
    3. 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.
    4. In each page that you intend to output, create a custom field called "page-desc" and add some short introduction text.
    5. 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]

  2. Posts like that tend to get lost a support thread. Have you considered creating a Codex article and posting that there?


    It's not really difficult to do and howto articles really do belong there.

  3. La M
    Posted 4 years ago #

    Am happy to do that, is my code up to scratch?

  4. See, that's the problem with posting code here, there's that pesky "don't post more than 10 lines" rule. ;)

    Follow that link I provided which also has http://codex.wordpress.org/Codex:Guidelines and use the existing articles as examples.

  5. La M
    Posted 4 years ago #

    Ah well

Topic Closed

This topic has been closed to new replies.

About this Topic