Questions tagged [children]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

List post from current taxonomy children

I have a custom post type and a taxonomy with children, with a template file named taxonomy-productcategories.php. On this i want to list all children with their posts. Child taxonomy 1 Child ...
0
votes
1answer
13 views

Query to Exclude Child Pages from Custom Post Type Archive

I have a hierarchical custom post type called "Services". On the Services archive page I want to display only parent Services and exclude child Services. I found similar answers to my ...
0
votes
1answer
23 views

check if current page is a child of a specified top level page

I am writing some code that will embed a chat bot to specified pages on my site. I have a function/shortcode that accepts 2 parameters, include and exclude. The value of each can be a single post ID ...
0
votes
1answer
905 views

Get count for all terms inside a parent term

I am trying to get the post count for a term and it's child terms. I tried it with pad_count=> true but this seems to have no effect. My term stucture is like the following: - term 1: 10 posts - ...
3
votes
2answers
2k views

Wordpress Child Category Display All Posts

I am creating a Wordpress page where all my posts in the child categories of team are displayed in a grid. I got this working with the below code. The formatting and general layout is great however it ...
1
vote
0answers
38 views

WP_Query with meta_query for children

I'm using WooCommerce and it has a lot of plugins to handle different stuff. The one thing needed by the client that no other plugin manages correctly is which variations can be visible for each user ...
0
votes
1answer
37 views

wp_list_pages two columns

I have a piece of code that splits my wp_list_pages navigation into two columns: <div id="head"> <ul> <?php $page_s = explode("</li>",...
9
votes
2answers
14k views

Check if a post is in any child category of a parent category

In a site I'm developing, I have the following category structure: * movies (parent) * thriller (child) * comedy (child) * drama (child) The current post is in the comedy category. The ...
0
votes
1answer
83 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, ...
1
vote
2answers
99 views

How to target a specific custom post type post and its all children and grandchildren?

I will really appreciate your help to create a function that will check by a given $my_custom_post_type_name and $post_name and return true if the current page / post is a $post_name or $...
0
votes
2answers
15 views

Show children connected to parent pages

Can someone assist with a function code that displays children on a parent page. I have breadcrumbs for when standing on child page going back to parent but, I need standing on parent page to ...
18
votes
4answers
101k views

Get the children of the parent category

I'm trying to get all the children categories to display in this loop but I'm struggling with the code. This is what I have so far. <?php $args=array('orderby' => 'name', 'order' => 'ASC'); ...
1
vote
0answers
26 views

Taxonomies on custom taxonomies

I have a custom post type with multiple custom taxonomies. I need those taxonomies to have a relationship as well. The trick is, I need a child to be able to have multiple parents. I understand that ...
0
votes
1answer
262 views

Custom post type loop without children

I've created custom post type "Services" with 'hierarchical' => true,. My loop is simple: while (have_posts()) { the_post(); get_template_part('content', get_post_type()); } ...
0
votes
0answers
68 views

wordpress custom menu - show parents, siblings, children depending on depth

looking and trying for hours to find a solution for the following output of a wordpress custom menu. Hope you can help. I do not know where to start: custom menu walker, css, functions.php I have a ...
0
votes
1answer
697 views

Walker class for sub-menu with ACF fields

Firstly, I'm wondering if this is the best way to even do this. I have a basic nav, one item has children. The children need to be wrapped in a container div and each child needs to pull some ACF ...
0
votes
2answers
3k views

`get_terms()` with `child_of` and `childless` combined

I have a hierarchical taxonomy filter that contains locations and genres for posts with the custom type artist: - Genre -- Hip Hop -- Trap -- Rap - Location -- Europe --- Germany --- Sweden --- ...
0
votes
2answers
418 views

Menu walker: how to tell if a sub menu contains submenus?

I mean: <ul> <li> <ul class="sub-menu"> <li> <ul> <li></li> <li></li> <li></li> ...
0
votes
1answer
130 views

How to show children terms even if they are empty

First of all im not good at PHP so it might be the problem... So after trying to do what I want without success I want to ask our help. For most of you probably it will be easy as eating breakfast. I'...
0
votes
1answer
67 views

Child and Parent Pages list of sub pages

I have a parent page called services with children, each service child has child pages within it. On the first level child page i want to show all of the pages below it in. When i click through to ...
0
votes
1answer
778 views

How to display only the direct children of a term on a taxonomy page

I would like to have a couple of (automatically generated) taxonomy pages created by term name, term description and a listing of only the next level of subterms. (No parents and no grandchildrens) I ...
0
votes
2answers
14k views

Showing categories and subcategories with posts

Basically as the title says I want to get list of categories and subcategories and then posts(with links to them) for those categories/subcategories. This is the structure I'm trying to achieve: ...
1
vote
0answers
53 views

How to show all possible parents and children of a hierarchical taxonomy term?

I have a hierarchical custom taxonomy "company". Companies are hierarchical, they can have both owners and subsidiaries. So, some of my "company" terms have parents and children. Take this real ...
1
vote
0answers
202 views

Sort order by slug for looped child terms of custom taxonomy

I have page that displays multiple carousels that contains the posts for each child term of parent taxonomy: projects for the custom taxonomy: portfolio-categories for CPT: portfolios. When Portfolio ...
0
votes
1answer
3k views

Orderby menu_order not working; menu is sorted on publish date

I have made a menu in the admin page ordered like this: parent - child 1 - child 2 - child 3 parent - child 1 - child 2 - child 3 parent - child 1 - child 2 - ...
2
votes
4answers
2k views

Get ID of child from child slug, while knowing parent ID

I have a hierarchy that I need to get data from. It's the child (by slug name) that I need to get while already having knowledge of the parents. Highest Known Parent Page (slug : 'parent') |_ Child 1 ...
3
votes
7answers
14k 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 ...
0
votes
2answers
2k views

Permalink for PDF of article

I'm trying to learn if this is possible, and how I might go about implementing it. Our site is a scientific journal, and our published articles follow this permalink structure: http://ehponline.org/&...
0
votes
1answer
181 views

How to create template for children category?

I have categories ordered like this: continent->country->city I have managed to have different templates for continent and country(parend and child). But I need also different template for a city ...
1
vote
1answer
680 views

get_children() not working properly – Only on one post?

Client wants to show how many images await the reader in a post. I say: easy peazy. Now I realize: I lied. The system only uses galleries, even for single pictures. $images = get_children(array( ...
0
votes
4answers
638 views

Display children category images

I have worked four hours on this but with no result. There is a custom taxonomy and I need to display the image of the child category but displays the image of parent category. My code is: <?php ...
0
votes
2answers
3k views

is_child() function

My need is to check if a page is subpage of a page (with ID). I try to get this code working but it doesn't. function is_child($pageID) { global $post; echo $post->post_parent; // display the ...
0
votes
1answer
56 views

category & sub category order issues in wordpress

I have Two parent category on my website, and each of those category have children category, like this : constructions corollaires 01 02 03 04 Between two suns I II III ...
3
votes
1answer
8k views

Check if post has children or not

I need some code to know if the post has another pages or not unfortunately i didn't find yet now any reference for this so any idea will be appreciated What I need to acheive is if has child /...
1
vote
1answer
1k views

Display Child Pages of Custom Post Type Parent Page

I am attempting to display the child pages of a custom post_type page. I found a shortcode that works great for standard WordPress "pages" post_type, but doesn't work on custom post types. Here is ...
0
votes
1answer
1k views

How do I display child post types in the parent post type template

I have a custom post type called airports which uses a template called single-airports.php. I have created a new airport called Gatwick and created a child of this called called Gatwick North ...
5
votes
1answer
10k views

Exclude Child Posts from WP_Query

How can I exclude child posts using wp_query? Given the following architecture: parent 1 child 1 child 2 parent 2 child 3 child 4 I'd like to only return parent 1 and parent 2, and exclude child ...
0
votes
1answer
30 views

Displaying Child Page's Information

I am currently working on a custom template for a page, and I would like to pull various information from the child pages of the parent page, and display that information on the parent page. ...
5
votes
4answers
23k views

Show just one level of child pages, wp_list_pages woe

I'm working on a site that has a fairly large page structure a few levels deep - in some sections there are a lot of pages. The basic setup is something like this... Parent Parent Parent -Child -...
1
vote
1answer
982 views

How to Display child post on his parent post with thumbnail and content in WordPress

I am trying to display child post in his parent's post with thumbnail and content. I also created a custom post for products and manage to display only parent post in custom template product.php. Now ...
0
votes
1answer
238 views

WP_Query doesn't works inside loop

I'm trying to show a category and his children with this structure (whit this content()): - Category Father title - Children title - Other children title - Category Father title - .....
1
vote
3answers
2k views

Create subpage - filter parent pages list

I have a website here with a lot of content and with the content where is necessary to create pages in hierarchy. But it is uncomfortable to go through the dropdown in the administration with a lot of ...
1
vote
1answer
897 views

Category shows only top level child categories

I have found this code online but it shows all child categories when on parent category: <?php $this_category = get_category( $cat ); $child_categories = get_categories( array( 'child_of' =...
1
vote
1answer
14k views

Display Categories or Subcategories with name & description in category.php

I have the following issue for my customer. Can some suggest a possible solution to this issue? This website has Categories & Subcategories Cat1 -Subcat1 -Subcat2 -Subcat3 Cat2 -Subcat1 -...
0
votes
1answer
754 views

get_pages displays only parents instead of children

Hey there I am trying to fetch all direct children of a page. But I am getting only the parent two pages. Any ideas? Code: function childpages_func( ){ $args = array( 'child_of' => $...
0
votes
1answer
292 views

Better wordpress attachment query than this

I have a site with more then 10.000 posts and images, its classipress site. I need somehow to show all images from posts that are on pending status, and who havent expired(post meta). This is the code ...
5
votes
3answers
9k views

How to make child categories recognize parent's template displays

I'm using the Default Post Type post for various purposes. To sort them I'm using different categories. And I'm designing different category layout using the slug preference, like: category-book.php, ...
0
votes
1answer
29 views

Why does the first category returned get echoed twice?

I have a category called menu items (category id 19) and two child categories Tacos and Burgers. Why does Tacos get echoed out twice? I get Tacos Tacos Burgers. while (have_posts()) : the_post(); ...
0
votes
1answer
605 views

Running get_posts within get_posts to get children of children

I have a hierarchal custom post type called “courses”. When you arrive on a course post there’s a check to see if the post has children. If the courses post has children it runs get_posts to display ...
0
votes
2answers
12k views

List child categories from parent category on custom taxonomy page

I making some updates to a theme I'm currently working on. I've moved a bunch of categories that have custom post items under them into a parent category that's all within a custom taxonomy. e.g.: ...