Articles of child pages

Keep page hierarchy in wp_list_pages, even if on a child or grandchild

I have the following structure of pages, and I need to have that same structure displayed on those pages who have child pages: – Childpage – – Grandchildpage – – Other Grandchildpage – Other Childpage The following code is used to display the structure on page.php: <ul class=”sidemenu-list”> <?php if($post->post_parent) $children = wp_list_pages(“title_li=&child_of=”.$post->post_parent.”&echo=1″); else $children […]

Do we need to change our child function.php to require/include child dir files when we add an over-riding file.php into the child theme

With child themes we are supposed to leave parent functions.php in tact and extend it with the child functions.php. However parent functions.php typically define a whole load of include/requires which refer to files in the parent directory. Do we need to remember to over-ride these in our child function.php each time we create a child.php […]

Do not show child pages of child pages

I’m looking (without having to copy the whole code) that when the child page has child pages of it’s own that it wil not show those child pages but still the parrent page 2 levels up. i played with it but in my opinion i have to copy the whole code, change the level setting, […]

Custom rewrite rule for hierarchical custom post type

Working on a client site I’ve encounter my worst enemy… WP URL rewrite :(. I actually can’t figure it out and after many days trying and searching, I can’t make it work. What I’m trying to get is a permalink like this company.com/product/%product-name%/ regardless of the /parent/child/ nesting depth. I do need the functionalities of […]

How to have a custom URI path for specific page template

I have a custom template file called page_system.php. I have a page in WordPress called “System” which uses this template. The path to view this page is: www.mysite.com/system/ I want a way via htacess or otherwise, that would allow me to add anything after the path and put it in a get variable, so that […]

Displaying the first child page of the parent page

Rooms Rooms 1 Rooms 2 Rooms 3 Rooms 4 Rooms is the parent page and I want to display only the first child page. Currently, I am using the code: <?php $args = array( ‘child_of’ => 4, ‘title_li’ => ”, ‘sort_column’ => ‘post_date’ ); $pages = wp_list_pages($args); It is fetching all the child pages. I […]

When listing child pages run out of memory

I am currently having an issue with memory when my site tries to generate a tree of child pages. to my understanding query is too large (WP has 60000 pages) following is code i am using ?php global $post; wp_list_pages( array( ‘child_of’ => $post->ID, // Only pages that are children of the current page ‘depth’ […]

Custom page slug without creating a WP page

I am developing a WP plugin in which I have a WP page called my-account, but I have some more child pages of its like account-edit, account-misc etc… so I would like to call these pages in this way mydomain.com/my-account/account-edit and mydomain.com/my-account/account-misc I don’t know how to do this without creating WP pages, I have […]

Display child page content of a specific parent on home page

This has been bugging the hell out of me, it should be so simple! I have a list of child pages under the parent called ‘Our Homes’. The sitemap structure is as follows: Home Our Homes home 1 home 2 home 3 For each home I want to display the following: Title Content snippet Image […]

Query to list all galleries under a parent post?

I have many child galleries organized by their parent galleries (multiple parent galleries with several child galleries under). I would like to create a shortcode that is able to query all the child galleries under a specified parent gallery. I’m having a bit of difficulty… anyone care to help me out? This is the function […]