Questions tagged [child-pages]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

Child pages and sub-pages do not appear. Why?

I have created a child page. However, when I access "http://example.com/Page/ChildPage" does not appear? Page (filename = page.php -> content-page.php) [WORK] Child Page (filename = page.php -> ...
0 votes
4 answers
2k views

List child pages, exclude the current page

I'm trying to display the child pages of a parent page, this is working. But when I tried to exclude the current page in the list where the child pages displayed, it's not working. How to fix this? $...
0 votes
0 answers
13 views

How to create archive child pages with good Yoast SEO meta?

I want to create children pages to some archives on wordpress with Yoast SEO. Today, i have /tags/{tagName} and i want to add sub pages to this archive. The goal is to have: /tags/{tagName} main tag ...
0 votes
2 answers
32 views

Subpage for Custom Post Type

I have a custom post type "location". add_action("init", "register_custom_post_types"); function register_custom_post_types() { register_post_type("location&...
0 votes
1 answer
718 views

Display title of child pages in shortcode

I'm having a hard time figuring out how to display the title of the childpages as the id of a div. Assuming that 'news' & 'othernews' are siblings of the parent page home (39) I want something ...
1 vote
1 answer
1k views

Wordpress child pages not working

I am creating a wordpress CMS and I have added multiple pages under one parent page. I am generating the links for all the child pages of a page and then when user clicks on the links, they should be ...
1 vote
1 answer
788 views

Next and Previous Posts of Same Parent

I'm working on a website for a webcomic and I have a custom post type set up for comic pages. I have multiple series on the site and have made each comic page a child post of a parent (one parent for ...
0 votes
0 answers
24 views

How to pull through page title depending on which radio button is selected on the specific page?

I'm pretty new to Wordpress, ACF and PHP. I am currently working on a project, the website has 11 different sports centres all with different sport/activities, on each centre they will have a sidebar ...
2 votes
2 answers
2k views

select a private page as parent for another private page

I am trying to build a customer portal however the private page is not showing in the parent drop-down (The drop-down at the right bottom of page settings under page attributes). Both the parent and ...
0 votes
0 answers
16 views

Need help with child pages displaying as individual pages

We could really use some help, guidance, or any available resources related to our issue. On our WordPress website (using the free version of Elementor, Sinatra theme), we have encountered an problem ...
0 votes
1 answer
2k views

Child Theme not overwriting Parent theme php file

I'm new to Wordpress and how Child themes work. My child theme I am trying to overwrite two files in sub-directories. I've copied the parent files and edited them in child theme but changes are not ...
6 votes
4 answers
24k views

Is there a default template file for child pages / subpages?

This seems like a very simple question. I'm looking for something like sub-page.php or page-child.php where I can do some different things on the child pages of my theme. They are different enough ...
0 votes
0 answers
23 views

I have a website issue I am trying to resolve

My website is jthomascrowne.com titled "The View From Here". I am currently using the Twenty Seventeen Theme on a Wordpress Business plan. I am relatively new to this. I know nothing about ...
1 vote
1 answer
1k views

How to populate a parent page with its child subpages and associated templates

I have a decent understanding of Wordpress as well as the Advanced Custom Fields Plugin and I'm trying to write my parent page template right now, but I'm having trouble trying to figure out how I can ...
4 votes
3 answers
2k views

Some pages are missing from the Parent Page select in the Editor

Two of my top-level Pages, and all of their children, are missing from the dropdown menu in the Block Editor for selecting a Parent Page. There are no special characters in the titles or permalinks. ...
0 votes
1 answer
824 views

Use same page template for parent and child pages in a theme

I am working on a template which one uses on both parent and child pages. Suppose I have a: template name: TEST I need to use that template on both parent and child pages: Parent page name -> ...
-1 votes
2 answers
1k views

One set of Child Pages redirecting to Home page?

I've searched multiple forums, and not finding anything quite like this... On a site I manage, there are several parent pages with links to child pages embedded in images. Each image links to the ...
-1 votes
1 answer
983 views

404 on child page template

I have a page called portfolio and I have created several child pages for it like Video page, audio page etc … I also created custom page template for portfolio and named its file portfolio-template-...
1 vote
2 answers
422 views

$pages = get_pages('child_of='.$post->ID); Why arguments are concatenated?

I am reading a book called "Learn to Create WordPress Themes by Building 5 Projects" . In that to retrieve the parent for pages, they have a function to get the parent of the pages. The ...
0 votes
0 answers
99 views

Custom child page permalink

I'm trying to customize the permalink of some child pages. I have this structure: example.com/story/story-name-slug/chapter-slug/page-slug And I'm trying to transforming that structure into this: ...
1 vote
1 answer
69 views

Append a code when at the current page in wp_list_pages()

I'm using wp_list_pages() to show pages and subpages in a tree view and I need to add a "read more" as a sub-item right after the current page. Example: We are at the "Page tree" ...
0 votes
1 answer
147 views

complex get_posts() query to select child pages

I have pages on 2 levels under the main deparments page like below. Departments --Department 1 -----Course 1 -----Course 2 --Department 1 -----Course 3 -----Course 4 --Department 3 --Department ...
1 vote
1 answer
438 views

How to add numeric slug for child page in WordPress 5.9?

I am trying to configure WordPress 5.9 to allow numeric slugs for child pages. Drawing from the 2015 answer to a similar question I took the up-to-date code of wp_unique_post_slug, removed || ...
3 votes
2 answers
24k views

How to display list of child pages of parent page in wordpress?

I have following format of menu. Treatment -Beauty --Services --Products -Surgery -washing I have followed follwed following link: How to Display a List of Child Pages For a Parent Page in ...
2 votes
0 answers
81 views

Child post with numeric only slug keeps redirecting to parent

I modified the allow-numeric-stubs plugin code to work with CPTs. You can view my forked repository here: https://github.com/akshatkedia/allow-numeric-stubs WordPress is now allowing numeric slugs for ...
15 votes
7 answers
38k views

Check if is on child-page of a particular page

I am trying to output a logo depending on which page is being viewed. <?php if ( is_page('home') || is_page('services') ) { ?> <div class="col-md-2 col-sm-4"> <?php ...
2 votes
2 answers
448 views

Remove custom post type slug not working for child pages

I'd like my custom post type, products, to not use a slug, eg: domain.com/product-name. The code below sorts that out nicely, however it fails to work with child pages, eg: domain.com/product-name/...
1 vote
1 answer
173 views

Wordpress get the child pages of current page

I want to display the child pages of the current page you are on. <?php wp_list_pages('child_of=67&sort_column=menu_order&title_li=') ?> If I give the id number like above it works ...
1 vote
2 answers
619 views

Pagination of a WP_Query Loop in a child-page page template

See edit at bottom. I have a wp_query loop in a page template for a custom post type ("success_stories"). The loop itself works fine but I cannot seem to get pagination working. I've tried ...
1 vote
1 answer
58 views

load common thank you template with different content for different pages

i have created a template called thank-you.php and inside that i want to show different content as per the parent url. for e.g. mywebsite.com/page/thank-you and mywebsite.com/another-page/thank-you. ...
0 votes
1 answer
45 views

How to highlight 1st level menu item based on actual page

I am trying to highlight 1st level menu item by adding 'current-menu-item' class using nav_menu_css_class filter based on actual page / article / post / etc. For example, menu looks like this: ...
1 vote
1 answer
76 views

List child pages of current page but limit to specific year

I have an old site that has sooo many child pages that I'd like to limit the return of child pages on a current page to just a specific year so that I can pull each year into an accordion. I am ...
1 vote
1 answer
448 views

wp_insert_post if page doesn't exist under current page

I am trying to dynamically insert a page/multiple pages as a child under the current page in my template file, using wp_insert_post, however I need to first check if the page title already exists ...
0 votes
1 answer
1k views

Query to get child pages of current page and display it in action hook

First I want to apologize if there are spelling mistakes in this question. I'm using Genesis Framework. According to the following answer: https://wordpress.stackexchange.com/a/60295/146574 I'm ...
0 votes
1 answer
708 views

Check if parent page has child page of certain slug

I currently have a function that checks to see if the page is a parent, and if so, do stuff. But I also want to check to see if the parent has a child page that has a certain slug. Basically, how ...
0 votes
1 answer
152 views

Show child by slug, while knowing parent ID

Im trying this to show My CurrentPage (Licenciatura en Ciencias del Arte y Gestión Cultural.) child called "Infraestructura" by it's slug. I don't know whats wrong with my code. It Returns ...
1 vote
0 answers
28 views

Verify if the current page has at least one published child

In my theme php page template, I need to echo a string only if the page has at least one published child page. Actually, I have a function that verifies if the current page has any children, ...
1 vote
1 answer
2k views

Can I make Wordpress use a custom template for a child page

I have a custom post type called communities. Then I have the appropriate single-community.php page. Works great! So we want to use some of these "communities" as parent pages. Then underneath them ...
0 votes
1 answer
1k views

Page access only from a specific page in wordpress website

I would like to know if it possible to have a page that open if and only if the visitor comes from a specific page (which in my case would be the homepage). So for example, the visitors land on the ...
55 votes
4 answers
162k views

wp query to get child pages of current page

Can anyone please help me to with the wp_query. I am making a template file/loop to create and archive page of the current page children pages. This query needs to be automatic as I am using in on ...
0 votes
1 answer
1k views

Get first level children of a page ID

I am looking to get immediate children of a page ID. I tried below code, but it does not seem to work $pageIDchild = get_pages( array ( 'parent' => 0, 'child_of' =>$pageID, ...
2 votes
1 answer
1k views

Child page in custom post throws 404 page not found

Currently I am trying to add a page as a child in my custom post section. The parent pages in my custom posts works correctly, I've set a template file for them as singe-custom_post_name.php. All good....
0 votes
1 answer
1k views

Limit the number of child page displaying

I created a code for querying child pages when we're on a parent page and also display brother pages if we are on a child page, and works amazing... now my problem is, I cannot find a parameter like ...
1 vote
1 answer
2k views

Search pages that are a child of the current page

I'm developing my own Wordpress theme and I was wondering if it is possible to modify the search query in a way that it only return results that are child pages of the actual page. The reason I want ...
0 votes
1 answer
37 views

How do I find out which (page) template file my custom child post is looking for?

I am trying to make something like a web-app with WP. One of the issues I'm facing now is that I cannot find out which page template file my post is looking for. I have looked at template file ...
0 votes
1 answer
696 views

How to get an array of pages ID by some page's slug and all its children pages in get_posts() function?

I have a custom function in my theme that creates a dynamic sitemap.xml file. For that I'm using $myVar = get_posts( array(...) ). In that array I need to exclude some pages. I want to exclude some ...
0 votes
2 answers
1k views

Exclude parent with child pages from WP_Query

How can I query only those pages that DO NOT HAVE child pages? E.g.: Parent page 1 Child page 1 Child page 2 Parent page 2 Parent page 3 Child page 1 Child page 2 Parent page 4 I would like to ...
0 votes
1 answer
83 views

Return true if parent page id matches

I'm trying to write a function (with little luck) that does a simple check against the top level parent page and returns true if the ID matches a supplied ID number. For example; If I'm on page ...
0 votes
1 answer
113 views

Only one parent page showing

I'm working with the Incubator theme. I have created two other parent pages but they come up blank, with no content. The only way they show content is if I set them, one at a time, as the homepage in ...
1 vote
1 answer
671 views

Need wp_query to return all children and grandchildren

I am working on a site with three different main 'topevel' sections, that act as the top level parents of the site. Each toplevel section has children and grandchildren, and there needs to be a ...

1
2 3 4 5 6