Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [children]

The tag has no usage guidance.

0
votes
0answers
22 views

Display taxonomies that used

Well, I need th display names of taxonomies that used by post of special taxonomy . for example I have a taxonomy for restaurants and in that taxonomy I have two parent : City and Country , so I have ...
0
votes
1answer
22 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
43 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
37 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
21 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
51 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 ...
1
vote
0answers
36 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
94 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
2answers
564 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
1answer
932 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 - ...
1
vote
1answer
215 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
165 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
869 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
103 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
1answer
48 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
3k 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
583 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
72 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 ...
0
votes
2answers
7k 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: ...
0
votes
1answer
27 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. ...
1
vote
1answer
596 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
175 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 - .....
0
votes
1answer
418 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' =...
0
votes
1answer
270 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
28 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
251 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
1answer
841 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 ...
0
votes
2answers
820 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
621 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 - ...
0
votes
1answer
358 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 ...
0
votes
0answers
21 views

Help understanding custom post type and children

We are considering restructuring our Wordpress site, and I'm trying to better understand how to use custom post types and (possibly) child posts to better organize and control content. The site has ...
0
votes
1answer
251 views

get children from current variable (taxonomy) via shortcode

I am working on a portfolio site and I need to modify this part. It is a filter of categories, placed via a shortcode. I want to show only the children categories of the selected category of my ...
0
votes
1answer
404 views

Show all child categories associated to post ID within loop

I'm looping through all posts and I'm trying to output the category nicename related to each post. So if there are categories A,B and C with post X only associated with categories A and C then I only ...
1
vote
1answer
807 views

How to get the excerpts of all children pages

I'm currently trying to get this working: I want to display a list of excerpts of all children pages within my parent site. According to the WP Codex this ist possible through 'get_pages' function ...
0
votes
1answer
22 views

Need list of child category post titles sorted by child category

There seem to be a lot of variations of this type of question, but I have not been able to find one that matches my specific situation or that is less than 4 years old. We have WordPress 4.1.1 I ...
10
votes
2answers
18k views

A check for if is parent page, if has children, if has grandchildren

I have one default page template that I wish to use for two scenarios. I'd prefer to use only one page template for the sake of simplicity for my client. Here's what I'm trying to accomplish: if ...
1
vote
1answer
429 views

Advanced or not so advanced pre_get_posts query

I would like to only show posts that have "now and future" children using pre_get_posts action hook. Does anyone have an idea of how to achieve this? function pre_get_posts($query) { if(!...
-1
votes
1answer
509 views

loop mix my child-category and parent-category

i explain the situatio I'm having: I have a blog, which on the homepage, have display the most recent post. For each post category, I have set up one specific color and icon by css. ex: for ...
0
votes
1answer
699 views

Nested custom post types templating

I have multiple custom post types which I nested thanks to a plugin and post I found. I have a custom post type 'landen' ( which should be the parent post type ) and a child post type 'rondreizen', ...
0
votes
2answers
1k 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
1k views

If product is in sub-category show code

This code works with categories but not with child sub-categories. How can I make it work a child category that is not in the url (slug)? global $post; $terms = wp_get_post_terms( $post->ID, '...
1
vote
1answer
12k 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
2answers
10k 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
49 views

Children Shortcodes?

I started creating WordPress plugins a few weeks ago, and I would like to know if it's possible to somehow "embed" shortcodes in some others. Basically what I want to do is create a table or a list, ...
7
votes
4answers
707 views

How can I hide children of draft pages using wp_list_pages()?

I'm displaying a simple sitemap with wp_list_pages(); $args = array( 'sort_column' => 'menu_order', 'title_li' => '', 'post_status' => 'publish' ); wp_list_pages( $args ); The ...
1
vote
1answer
5k views

Show only first children level of current category?

I wish to display only first level of subcategories on current category page (if any). I tried this code: <?php $args=array( 'child_of' => $cat-id, 'hide_empty'...
0
votes
1answer
61 views

1st Level Page with No Children

I have a website (http://sfa.uconn.edu/) that displays left menu with a list of child pages on any parent page (and its children), like this: However, I would like to hide this functionality from top ...
6
votes
1answer
10k 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
519 views

How to customize taxonomy archive template files for subterms?

I have a taxonomy called "location" where I have the term "Asia" and the sub-term "Thailand". Now I created the taxonomy archive template file according to the Wordpress Codex, which is working in ...
-1
votes
2answers
1k views

How to retrieve posts from parent category, splitting them per children when displayed?

I have a Wordpress database with three categories: ID 3 : Europe ID 4 : France (child of 3) ID 5 : Paris (child of 4) I now need to display all posts under their respective category, like this: ...