The tag has no wiki summary.

learn more… | top users | synonyms

5
votes
2answers
301 views

Allow only new sub-pages to be created

Here is an amazing solution to restrict the creation of new parent pages, and I would want to use it, but the newly created sub-pages are saved only as drafts and this was not solved (see last ...
5
votes
1answer
571 views

Create a “Dummy” parent page for a hierarchy in page listing?

Is it possible to set up a "dummy" page - just a page title that appears in the page listing, and a page that is not editable and doesn't have a slug? This is more of a hypothetical question, as I ...
3
votes
2answers
976 views

How can I programmatically create “child” pages on theme activation?

I know how to create pages automatically when a theme is activated, but I need help to figure out how to also programmatically create child pages at the same time. For example: - Page 1 - Page 1.1 ...
3
votes
1answer
953 views

Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error

Here we have a snippet from a functions.php file... add_action('init', 'create_recipes'); function create_recipes() { $recipes_args = array( ...some properies..., 'hierarchical' ...
2
votes
3answers
1k views

Advanced Custom Fields - Get custom fields from parent page

I'm using Advanced Custom Fields making it easier for my client to manage his content. On all of my child- and parent pages i would like to have the same header image and sidebar information. ...
2
votes
1answer
326 views

How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only

Is there a way to limit the creation of pages (custom post type) to a specific depth - e.g. level 1 (where 0 = parent, 1 = child, 2 = grand-child, etc.)? For example, let's create a 'Summer' recipe ...
2
votes
1answer
236 views

List the 5 most recent child pages

I created a hierarchical custom post type for a gallery. The parent pages are the galleries and the child pages are the albums. I want to display the most recent albums on my sidebar (so basically the ...
2
votes
1answer
167 views

Only allow new subpages to be created

I'm looking for a way to only allow users to create new subpages once there are nine pages that are parents/root pages. Once there are nine parent pages when trying to create a new parent the users ...
2
votes
2answers
137 views

Show child pages when on a child page

On my site I have a number of parent pages with associated child pages. How can I show all the child pages of one particular parent when a visitor is either on the parent page or one of it's children? ...
2
votes
1answer
706 views

query attachment images … if no attachments -> get attachments of parent page?

I use this to query all attachments of the current page or post I'm on … $query_images_args = array( 'post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => ...
2
votes
2answers
664 views

Custom post type hierarchical permalinks not behaving as expected for parent/child pages

When you have Pages with children, the permalink structure works something like this: example.com/parent-page/child-page/ All well and good. Trying to go to this URL: example.com/child-page/ ...
2
votes
0answers
360 views

Create child page within custom post type

I want to be able to have a link like this, site.com/my-custom-type-slug/single-custom-post-name/stats/, where /stats should contain the /my-custom-type-slug page content and when I add content to the ...
2
votes
1answer
577 views

Keeping parent menu items active in child pages

I'm a begginer in php and css. I would like to know how to keep an top-menu item underlined while navigating on child pages. Here is my layout: I have a navigation menu, listing all my parent pages ...
2
votes
1answer
804 views

Paginate Child Pages Content on Parent Page

I am using the following code to display child page content on it's parent page. The code is working great, but it currently only shows the latest two child page posts, is there any way to display all ...
2
votes
3answers
143 views

Page as a child of a Custom Post Type

I have a custom post type called "Professions", it contains different professions and info about them. To show them I simply use a content-profession.php -file. The thing is that I need subpages ...
2
votes
2answers
2k views

Remove parent slug for child pages

I'm looking for a plugin/custom function that removes the parent slug of a child's page permalink. Something that automatically changes the permalink for child pages. Example: ...
1
vote
1answer
381 views

Automatically create child pages when saving a (parent) page

I have a bit of a tricky one... I have a hierarchical Custom Post Type ('shows') that represents events. Is it possible for the user to create a new page (ie show), save the page and for Wordpress to ...
1
vote
1answer
2k 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 ...
1
vote
1answer
9k 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 ...
1
vote
1answer
551 views

meta_key & meta_value not working with get_pages and custom taxonomy

I'm trying to use custom taxonomy with pages. Basically a page has a "relevance" taxonomy, depicting who the page is relevant for. The pages are created in a hierarchy based on the departmental ...
1
vote
2answers
1k views

Get Permalink for the top level parent of child pages

I've this pages structure: TOP PAGE SUB PAGE 1 SUB SUB PAGE 1 SUB PAGE 2 [etc] Is it possible to display on each sub page a link to come back to the top level page? And how?
1
vote
1answer
91 views

Custom Field returning Numerical Value for Image rather than URL

I have been trying a way round my latest WordPress problem all morning and I feel now is the right time to shout and ask for help. I have been trying to create a people directory, I'm there except ...
1
vote
1answer
323 views

What is the optimal way to filter out subpages from admin?

I guess it's always possible to hide them with js, but is there a code snippet out there for query level child page filter? I only want top level pages to remain. EDIT: my coder came up with it, stay ...
1
vote
3answers
89 views

Multiple Conditions for Child Page Title

I've been trying to work with Conditional Tags and cannot wrap my head around this problem. PHP novice here. On sub-pages I need to display the parent page title as well as the page title. I have it ...
1
vote
1answer
70 views

Injecting a custom sql query into a page/theme

I have written a custom sql query for our WordPress website (fairly elaborate and not achievable with the standard wordpress code) and I've got it to run via $pageposts = $wpdb->get_results($query, ...
1
vote
2answers
536 views

List child pages of a specific page

I'm looking for a snippit/function that will list the child pages of a specific page (I guess by page ID) but not necessarily when you are on that page or a child of that page. The parent page ...
1
vote
1answer
572 views

get_pages - Display child then grandchild pages

I have a page structure like this. Portfolio - Residential - - Resident 1 - - Resident 2 - - Resident 3 - Commercial - - Commercial 1 - - Commercial 2 - - ...
1
vote
1answer
39 views

child of post type (custom)

I registered a custom post type (foo) with register_post_type, setting 'hierarchical' => true,so now when I want to use it I have post_type=foo. How can I query child of foo? any ideas? thanks!
1
vote
1answer
165 views

List all-childpages on parent-page AND list child-pages on childpage itself but not the current one?

I have the following function that lists all Child-Pages of a page. function show_subpages() { global $post; $subpages = wp_list_pages( array( 'echo' =>0, ...
1
vote
6answers
3k views

Prev/Next child navigation for current page?

How can I get a Previous / Next navigation that only navigates the child pages of the current page? By that i mean url.com/page/child1, url.com/page/child2 and so on.. I've been searching around ...
1
vote
1answer
62 views

Display the contents of a custom field of a page on their child

Let's see if anyone knows how to accomplish the following: I have a custom field, which is a textarea where the user can enter any text. The idea is that if a page is filled in that field, the entered ...
1
vote
1answer
2k views

Menu with parents, children and or siblings pages display

Here you see the parent menu selected in the horizontal navbar. I already have that working. I need a sidebar like they have with the same parent indicated plus children when they exist . At the ...
1
vote
2answers
354 views

Linking to Child Theme PHP Files

I have an existing website with html, css, js, and image files that I am trying to convert over to wordpress. I installed a clean local install using mamp on my hard drive and created a new child ...
1
vote
1answer
551 views

How to hide all child pages with post_query?

i have a page template as start page(home.php). i use a 2 columns grid to display all pages on that home.php with title and excerpt. unfortunately also my child pages are shown and i can't figure out ...
1
vote
2answers
134 views

Trouble with parent and child conditional tag to show content

I am trying to conditionally change a link based on what page a user is on, but I am having trouble finding the correct code to perform the action. Here is what I want to do (In English to explain ...
1
vote
1answer
988 views

how to properly list child pages in sidebar?

My pages menu is maximum 3 levels deep and I am having a hard time figuring out how to properly list the child pages in the sidebar. If a page is a parent I want to list it's direct child pages and ...
1
vote
1answer
27 views

Installing plugins and using complex folder structure with child theme in WordPress

I'm creating a new WP website based on a template, and I've created the child theme for this template. It is working without any problem. I understand the basics for a child theme as adding my ...
1
vote
0answers
26 views

Weird behaviour on Edit Menus screen

I am running WP 3.9.1. Fresh install. ACF and Gravity Forms are the only two plugins running. Perhaps someone had this issue before... On the edit menu screen I have a tab called "View All" where I ...
1
vote
2answers
47 views

Listing subpages title and content and styling the first iteration differently

So for now, every iteration looks the same and it's been a while since I dealt with php so could you help me? <?php $pages = ...
1
vote
0answers
12 views

query pages by a childs publish date

I am currently working on a wordpress project and would like to know if its possible to query pages by a childs publish date? I currently only want to show the parent page so my arguments look like ...
1
vote
0answers
125 views

Query Pages and post excerpts dynamically

I have a custom home page, a blog page which includes a dynamic preview area of the latest 5 blogs, and some other miscellaneous pages. Im trying to design an "events" page where the main page has a ...
1
vote
0answers
66 views

Removing Parent Page URL While Keeping the Navigation Intact

So here is the current format: site.com/parent-page/child-page/ - example 0 Child-page is ranking higher than parent-page, which is not what I want. So, I have a solution. site.com/parent-page/ - ...
1
vote
0answers
110 views

Parent/child pages and link structure the right way

I've always wondered what's the best way to achieve the following with pages. Say I have a (part of a menu) that looks like this: What we do Design websites Develop websites SEO The 'What we ...
1
vote
1answer
58 views

Organizing Your Pages

I'm having problems creating sub pages. So far I've followed the proper directions: Go to a new page, click the "Page Parent" drop-down menu. Select the appropriate parent Page from the drop-down ...
1
vote
0answers
618 views

Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content

I've never posted here, but I'm tired of slapping code together. That said, I would be most appreciative if someone could help me with this. I need a page template that: outputs the PARENT PAGEs, ...
1
vote
1answer
964 views

List child pages by slug not ID?

I am looking to use the wp_list_pages function to show children pages of a specific page ID. I was able to do this easily, but now I found an issue with it. I am running a Wordpress network of sites ...
1
vote
0answers
295 views

List Posts For Terms Of A Custom Taxonomy For Any Post Type

The function is great and i am using this function with these filter to just display selected taxonomy term posts by id, but what result i am getting is like this Child Taxonomy 1 - Child Taxonomy 1 ...
1
vote
1answer
4k views

Breadcrumbs showing Parent and Child Pages

We are trying to create a function for breadcrumbs that will show not only the path to the current page, but also to other pages with the same parent page. For instance, on ...
1
vote
1answer
226 views

Create Wordpress child page from page actions

I am trying to add an option to create a child page from the wordpress all pages screen. I found this link, but cannot get it working properly. It is exactly what I need, but I need help fixing it ...
1
vote
2answers
643 views

Can't change parent page

Some of my pages are children of "home". I want to assign them to a new page. But I cant change the pages parent. Everytime I try and publish, it just switches back to "home". I am using the ...