Questions tagged [children]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
801 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
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 ...
1
vote
2answers
47 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 ...
17
votes
4answers
85k 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'); ...
0
votes
0answers
11 views

How to limit creation of terms beneath a certain depth?

I'm dealing with some custom hierarchical taxonomies. In the taxonomy templates I'm only displaying the capital terms and one level of child terms. Naturally, I'd also like to restrict, on the backend,...
1
vote
0answers
24 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
180 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
17 views

Loop to show WP pages, their children and their grand children and content of each

I needed to make a loop to get a list of pages and show the children and grandchildren for each page, as well as truncated content of each result. I couldn't find this as a question anywhere and this ...
0
votes
0answers
38 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
479 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
2k 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
182 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
102 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
42 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
365 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
11k 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
49 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
189 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
2k 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
13k 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
141 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
469 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
420 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
2k 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
54 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 ...
2
votes
1answer
6k 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
847 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
941 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 ...
4
votes
1answer
9k 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
29 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
22k 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
828 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
215 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
714 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
539 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
288 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 ...
4
votes
3answers
8k 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
465 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
11k 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.: ...
0
votes
1answer
313 views

“Static” Child Menu with Accordian

I'm looking to create a child menu and none of the examples in the Wordpress codex seem to do what I'm trying to create. I have a main horizontal nav bar, which is fine. When clicking on a top-level ...
0
votes
2answers
1k views

(get_post_ancestors == 2) is returning true on 1 as well?

I am trying to use this code: <?php if(count(get_post_ancestors($post->ID)) == 2 ) : ?> <script>...</script> <?php endif ?> to add a script to a page but only if ...
0
votes
1answer
385 views

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 ...
6
votes
1answer
12k 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 ...