Show Parent Page
-
Is there a shortcode for showing the name and providing a link of the parent page?
The blog I need help with is: (visible only to logged in users)
-
Hi,
Any static page has its own URL, but it’s not clear what you mean by a shortcode of a parent page.
-
-
You may use any text in a link to a page, even a single character. For example, here the letter O links to your category page “Oracle 11G.”
The link URL and the link text are including in the HTML code of the link, which looks like this:
<a href="https://randallsims.wordpress.com/category/oracle-11g/">O</a> -
Well, for example to show child pages on a page, you would use the shortcode [child-pages]. Is there something like this for showing parent pages?
-
For example, shortcode [child-pages] shows all of the child pages of the current page. Is there a shortcode for parent pages?
-
Sorry for misinterpreting the question in the OP. I’d forgotten about the [child-pages] version of the list pages shortcode.
The [list-pages] shortcode will display all pages, including parent and child pages. So a code that displays only parent pages should be possible using the “exclude” and “include” customization arguments found in the
Customization Options section of the List Pages Shortcode support page. Those options involve adding page IDs to the shortcode.If by parent pages you mean all top-level pages, including those that have child pages and those without, then the “depth” parameter, with the value “1” (add ‘depth=1’ to the shortcode) might be easiest way to go.
I’ll call for staff attention in case I’ve missed a better option. Staff will respond here.
-
-
Okay, thanks. I was hoping someone could tell me how to write the shortcode using the options as I did see the options, just wasn’t sure how to get them to do what I wanted. I still don’t know how, but see that i was on the right page.
-
- The topic ‘Show Parent Page’ is closed to new replies.