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 only shows the 5 most recent posts in the child category instead of all of them. In my Wordpress account I have 7 posts which should be displaying. How should I retrieve the posts so it displays them all. <ul class="faces"> <?php …
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 taxonomy 1 Post A Child taxonomy 1 Post B Child taxonomy 1 Post C Child taxonomy 2 Child taxonomy 2 Post D Child taxonomy 2 Post E Child taxonomy 2 Post F And so on... I have an example for getting just the Child taxonomy, but i want …
I am trying to search and want to get results only from the Child - Sub Pages of their parent page. In the following code, I just get results from child pages, not subpages. Please help Understand the Root: Parent Page child 1 sub child a sub child b child 2 sub child a sub child b child 3 sub child a sub child b Note: (When I search anything Results comes only from their child and not from subpages) …
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 - term 2: 1 post -- subterm 1: 4 posts -- subterm 2: 12 posts - term 3: 4 posts This is my code: $args = array( 'pad_counts' => true ); $terms = get_terms('category', $args); foreach($terms as $term) { var_dump( …
Hey i am using a callback for wp_list_comments. I took the Code from here - 5balloons.info/custom-html-for-comments-section-in-wordpress-theme/ Now children comments are out of main comment (means children comment's <ol> list is out of the parent comment's <li>. Let's check an example - <ol class="list-of-comments"> <li class="parent-comment-1">Anything</li> <ol class="children"><li></li></ol> </ol> so how to change children comments ol to ul. how to add a class to this. how to move it inside parent-comment-1(1 is id of comment) So overall how to customize children …
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/<article-slug> i.e. http://ehponline.org/1306796 Every article that we publish has a corresponding PDF that is available for viewing/download. Those PDFs are currently stored outside of the WP Media structure. What I am wondering is if there is a way to have a permalink URL for each article such as this: http://ehponline.org/<article-slug>/pdf …
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 question, which is to customize the main query within archive-services.php using the following: function exclude_children( $query ) { if ( $query->is_main_query() && !is_admin() && $query->is_post_type_archive( 'services' ) ) { $query->set( 'post_parent', 0 ); } } add_action( 'pre_get_posts', 'exclude_children' ); But the child services are still displayed. Why doesn't this …
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 or a comma-separated string of post IDs (that are later converted to arrays in the shortcode function). If both parameters are null (default), the bot will be embedded on every page of the site. If correct values are passed to either, the …
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 role. So what is happening on the website is that we're having 6 different roles for registered users and each of them can see only some of the variation of each product. The following code manages the showing of the variation in the product …
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 has_term function with the following parameters returns true: has_term( 'comedy', 'category' ) But, the same function with the following parameters returns false: has_term( 'movies', 'category' ) My question is, is there a core function to check if the current post is in any child category of a specific …
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, 'sort_column' => 'menu_order' ) ); Any help is greatly appreciated. Thanks!
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 $post_name_child or $post_name_grandchild and so on based on the provided parent slug and custom post type. Let's say this is the structure: my_custom_post_type_name -first_page (example.com/my_custom_post_type_name/first_page) --first_page_child ---first_page_grandchild --first_page_child_2 -second_page --second_page_child ---second_page_grandchild I want to be able to target all pages that are first_page or its children / grandchildren …
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 display all children in UL/li list below the page title
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'); $categories=get_categories($args); foreach ($categories as $cat) { ?> <dt><a href="#" class="customer-acquisitiontop" id="<?php echo $cat->slug; ?>" data-filter=".<?php echo $cat->slug; ?>"><h2><?= $cat->cat_name; ?></h2></a></dt> <dd><div class="services"> <?= $categories=get_categories('parent'); ?> /*This should be the children of the parent category */ </div> </dd> <?php } ?> Any help would be great
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 the current db structure for WordPress doesn't allow for this, but I was curious if anyone has dealt with this and had an elegant solution. I'll update if I figure it out first.
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()); } In admin I have next structure: Service 1 Service 2 Sub-service The problem is that on Services page I have all of them. But I want only 1 level posts without children posts. And children posts should be inside parent post. How can I do that?
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 custom menu with "individual links" (so no pages or posts or categories) with Link and Link-Text. Right now depth is 5 (could be 6,7.. in the future). Example menu: Sport Bike Bikeparts Seats Mountainbike Roadbike Breaks Break Levers Adapters Bike Add Ons Bottle …
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 values from its associated page (image, ACF repeater values). The children are basically tiles with content + background images. Is a walker class the best way to achieve this? The only thing I can manage to do is affect all …
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 --- Austria -- Asia --- China --- Japan --- Taiwan Now I would like to use get_terms() to only get the Countries (children of 'Location' without children of their own). I thought this should work: $location_parent = get_term(123, 'filter'); $countries = get_terms(array( 'taxonomy' => $location_parent->taxonomy, …