Can I add sub pages to a gallery page in WordPress.com?
-
The display is quite different in each instance, however both will appear in the sidebar below the regular navigation links.
The List Pages shortcode in a Text widget will only appear when your site visitors are on the Gallery page (because that is where the child pages are present) and will display the child page links alphabetically.
If you create and use the Custom Menu widget, it will appear on every page (unless you change the widget’s visibility settings) and you can arrange the list of child pages in whatever order you wish.
Because these links are in a separate widget, there will be a gap between the top navigation area and the widget content.
-
The List Pages shortcode in a Text widget will only appear when your site visitors are on the Gallery page (because that is where the child pages are present) and will display the child page links alphabetically.
I don’t follow your reasoning here. First, child pages of a gallery page are distinct pages. How are child pages of a gallery page present on the gallery page? Are you thinking of a Grid Page Template page?
Also, it is my understanding that List Pages Shortcode will display all published pages, or that portion of pages that your specific customization of the shortcode commands it to display. In my experience with that shortcode, this is how it works. You could use the “child_of” customization option to limit the pages displayed to children of a single page, identified in the code by the page ID, or impose other restrictions with various customization options which may limit the pages displayed, but these options wouldn’t have any effect on where the widget displays.
Why wouldn’t the text widget with the List Pages Shortcode display on every page, post, archives page, etc. on the site, unless you set the widget visibility to limit where it appears?
-
unless you set the widget visibility to limit where it appears?
…or unless the theme itself limits where the widget will display, but I’m not finding the latter to be the case in my tests.
-
@doc-When I added the Text widget with the *child-pages* shortcode to my test site, the only page where those child-pages were listed in the Text widget was on their Parent page. That is also what it says in the Support doc:
The [child-pages] shortcode will display all the child pages of your current page. Child pages are pages that are under a parent page.
So if you are viewing the homepage, those child pages would not display in the sidebar. (temp screenshot)
Late here now, maybe more tomorrow if I can get my cooking done early. :)
-
Hi justjennifer,
Warning: This definitely may be a tl;dr post!
Let me first say that using a Custom Menu Widget would be a fine way to go, since on the Publish theme child pages are displayed indented below the parent in that widget. In my opinion, the following results of tests I ran today leave the Custom Menu Widget as the best option of those I’ve considered.
Regarding the “child-pages” shortcode:
Yes, I see what you mean now, but it’s not necessary to the use the “child-pages” shortcode version of the List Pages Shortcode. Some of the ways that @miqspiqs could display the four pages he wants to, include the following:1. Use the Pages Widget, excluding irrelevant pages from the widget. Unfortunately, on the Publish theme, the pages widget does not display page hierarchy, so the child pages will not be differentiated from the parent.
2. A basic link list constructed in a text widget, with the child pages indented below the parent page. The basic form of the code would be something like the following:
-
<li class=”page_item page-item-35 page_item_has_children”>Gallery (parent)
<ul class=”children”>
<li class=”page_item page-item-150″>India
<li class=”page_item page-item-152″>Egypt
<li class=”page_item page-item-154″>Hong KongI used a shortcut to create this list by displaying the Pages Widget in the sidebar widget area of my test site, and then copying and pasting the portion of it containing these four links. The problem that I found with this solution is that on the Publish theme, the page hierarchy does not display when it is inserted in a text widget.
When I constructed a link list in a page, with the child pages indented with the indent tool, and then copied and pasted that code into a text widget, again the child pages failed to display indented below the parent.
3. Insert the basic Lists Pages Shortcode, customized as follows:
a. With ‘include’ or ‘exclude’ arguments added, such that the shortcode limits the displayed pages to only the desired four pages. Again, with these options the parent and the child pages would display without a hierarchy, in this case regardless of the theme used.
b. With the ‘child_of=Page ID’ argument added, using the Page ID of the gallery page (parent). The problem with this one is that the parent page wouldn’t be included. This is may be the least appropriate option of those I’ve mentioned here.
Regards,
doc -
Ay! I forgot the code button. Let’s try that link list again:
2. A basic link list constructed in a text widget, with the child pages indented below the parent page. The basic form of the code would be something like the following:
<ul> <li class="page_item page-item-35 page_item_has_children">Gallery (parent) <ul class="children"> <li class="page_item page-item-150"><a href="https://rgphotographic.wordpress.com/gallery/india-2009/">India</a></li> <li class="page_item page-item-152"><a href="https://rgphotographic.wordpress.com/gallery/egypt-2008/">Egypt</a></li> <li class="page_item page-item-154">Hong Kong</li> </ul> </li> </ul> -
Thanks, justjennifer
Here’s a simplification of the above link list, minus the page item numbers — I don’t know what those are or where they came from — and with a link to the Gallery page included. Hong Kong is not linked, because I didn’t find that page on @miqspiqs site.
<ul> <li><a href="https://rgphotographic.wordpress.com/gallery/">Gallery</a> (parent) <ul class="children"> <li><a href="https://rgphotographic.wordpress.com/gallery/india-2009/">India</a></li> <li><a href="https://rgphotographic.wordpress.com/gallery/egypt-2008/">Egypt</a></li> <li>Hong Kong</li> </ul> </li> </ul>Again, the page hierarchy won’t display on the Publish theme when this code is inserted in a text widget, but it may be helpful for someone using another theme.
-
Thanks very much for all the effort and info although at my current level of expertise it is somewhat overwhelming. I might need 6 months at Bletchley Park before digesting and understanding all your coding! Nevertheless I shall have a go and see where it takes me.
Even in my limited capacity this seems favourite “The List Pages shortcode in a Text widget will only appear when your site visitors are on the Gallery page (because that is where the child pages are present) and will display the child page links alphabetically” as I think it encompasses what I want.
-
Well it didn’t take long for me to get confused! I went to a help file and it said:
1 Go to Appearance > Customize in the WordPress Administration Screens.
1 Click the Widget menu in the Theme Customizer to access to the Widget Customize Screen.
2 Click the down arrow of Widget Area to list the already registered Widgets.
3 Click Add a Widget button at the bottom of sidebar. It shows the list of available widgets.
4 Click a widget you want to add. The widgets should be added in the sidebar.Did that. I then see “Title” and Content” to be entered but I don’t know what to enter. More help please. :-(
-
Thought a bit about it. Would the title be say India and the content be
<li class=”page_item page-item-150″>India
or is that too simple? I just copied it from Docs’s post so please forgive my plagiarism!
-
I then see “Title” and Content” to be entered but I don’t know what to enter. More help please.
If you’re referring to a text widget, then the title may be whatever you want it to be, or you may leave it untitled. The content would be the list that I provided above. The third version of the list, in my post immediately preceding this one, is the simplest and most appropriate. I’ve included links to three of the four pages in that list, a link to Hong Kong being omitted because I’d been unable to locate that page on your site.
That being said, given the behavior of the Publish theme with respect to not displaying page hierarchy in a text widget, and not differentiating between parent and child in a list inserted into a text widget, as I’ve described above, using the Custom Menu Widget would probably be the most appropriate option in this case.
Regarding your question on the code
<li class="page_item page-item-150">India
The “page item” class identity is unnecessary. I removed that from my latest version of the list. The HTML code of a list of containing “India” alone, without a link to it, would look like this:<ul> <li>India</li> </ul>There is a page titled “India 2009” on your site. If we include a link to that page on the word “India” in the above list of one item, the code would look like this:
<ul> <li><a href="https://rgphotographic.wordpress.com/gallery/india-2009/">India</a></li> </ul> -
So if I put this in the custom menu widget content page it will work as I want, i.e. India 2009 page in hierarchy after Gallery? If that is so I’m getting close!
<u1>
<1i><a href=”https://rgphotographic.wordpress.com/gallery/india-2009″
</u1>
Are the quotation marks (“) positioned correct as your grab was missing a little at right side? Please check.
Obviously I could just try but If you forgive me but I’m a bit paranoid at getting into a position I am unable to get out of as I understand very little of coding etc. Thanks.
-
So if I put this in the custom menu widget content page it will work as I want
Sorry, I guess my instructions haven’t been clear. I suggested a Custom Menu Widget as the most appropriate option in this case, but I haven’t provided any instructions on using that widget, just the link to the support page.
The HTML codes for lists that I’ve provided in this thread aren’t for the Custom Menu Widget. They are to be placed in a text widget, if you choose option #2. from the alternatives to using the Custom Menu Widget that I suggested in this post of this thread.
The Pages Widget may be the simplest option, which is why I made it #1. in my list of alternatives to the Custom Menu Widget. However, the pages widget won’t display parent-child relationships (aka hierarchy) on the Publish theme.
-
Are the quotation marks (“) positioned correct as your grab was missing a little at right side?
Your attempt to copy the code I provided in the code box hasn’t duplicated the complete code. If you highlight the code by dragging, with a mouse, either from the beginning of the code to the end, or from the end to the beginning, the entire code should be highlighted, and can then be copied in full. I don’t how that would work on a touchscreen, without a mouse.
-
< ….. If you highlight the code by dragging, with a mouse, either from the beginning of the code to the end, or from the end to the beginning, the entire code should be highlighted, and can then be copied in full.>
Yes thanks I now see.
I have added the menu items ok now using Custom Menus but not into a hierarchical list under the Gallery page, to be seen on the Gallery page only. You have suggested that this may not be possible with the Publish theme I have chosen. But hey … I’m happy with what I have achieved so far!
-
…. oops! I tried to do a quote window as you have but unsuccessfully as you see, and no preview or edit button here! How do you do that and also make a link on text?
-
I have added the menu items ok now using Custom Menus but not into a hierarchical list under the Gallery page, to be seen on the Gallery page only.
I’m not sure what you mean by “to be seen on the Gallery page only,” but I certainly didn’t mean to suggest that. Are you using a Custom Menu Widget, as I suggested? If you were, then it would display separately from your custom menu in the sidebar widget area. You see, the sidebar widget area displays both the menu and widgets, but there will be a small break between them.
What I did say in this regard was
…on the Publish theme child pages are displayed indented below the parent in [the Custom Menus] widget.
However, I’m not finding that to be the case now. Sorry about that. I may have previously inadvertently tested it in a different theme. Wish I could go back to page 1 of this thread and edit, but I can’t.
A revised list of available options for displaying a list of links to a page and its child pages on the Publish theme follows. The options are the best that I’m aware of, but in every case either the page hierarchy or the equivalent indents do not display on this theme.
- Custom Menu Widget
- Pages widget
- Unordered Links list inserted into a text widget
- List Pages Shortcode inserted into a text widget, with ‘include’ or ‘exclude’ arguments added
-
I tried to do a quote window as you have but unsuccessfully as you see, and no preview or edit button here! How do you do that and also make a link on text?
Quote a passage, phrase, word, etc:
1. Copy the text that you want to quote.
2. Paste it into the post editor window.
3. Highlight the text to be quoted.
4. Click on the “quote” tab in the toolbar above the post editor window.
5. Submit the post when you’re finished editing it.As you’ve noted you can’t preview here, or edit the post after publishing. What I’ll often do is do the editing in a page on one of my sites, previewing it there. When it’s looking as I want it to, I’ll then copy (in HTML editor) and paste the text into the window here.
Make a link on text:
- See the Links support page.
-
You might want to consider switching to another theme, because on many themes, the page hierarchy might display in the custom menu you’re presently displaying, and the page hierarchy, or the analogous indents when applicable, would display with any of the options that justjennifer and I have suggested, with exception of the List Pages Shortcode with either the “exclude, “include” or “child_of=Page ID” arguments added. I’m not sure that the “include” and “exclude” arguments prevent page hierarchy from displaying on all themes, as I suggested on page 1 of this thread, but it has done so on those themes that I’ve tested. On the other hand, the basic List Pages Shortcode will display page hierarchy on some, perhaps many, themes.
- The topic ‘Can I add sub pages to a gallery page in WordPress.com?’ is closed to new replies.