Problems with a query in a wordpress taxonomy

0

I am making a query to bring a list of software that I have in this layout web list that I refer is punching, profiling (which would be the children in this case Radan) and items (are the son of the child) that has each drop-down, these items would be the single of products osea post type, the list would be the taxonomies named category of software attached an image of how the charge What I need to bring are the post single that would be what is in the drop down. (Radan Essential Punch - Radan Radpunch - Radan Radnest)  The layout on the other hand has other software where only the product has only one child and not in the would not be deployable.

Original Wordpress where I'm doing this would be: website eye! because I probably have caching problems and do not show me the content

Now the code I assemble is as follows.

<div id="accordion-container">
  <?php $terms2 = get_terms( array(
						'taxonomy' => 'tipo-software',
						'parent' => get_queried_object()->parent,
						'hide_empty' => false,) 
					);
					?>
  <?php if($terms2){
						foreach ($terms2 as $termNivel2) {
							$args = array(
								'posts_per_page' => -1, 
								'post_status' 	 => 'publish', 
								'post_type' 	 => array('producto')
							);
							$taxo_arg[] = array(array(
								'taxonomy' => 'tipo-software', 
								'terms'    => array($termNivel2->term_id), 
								'field'    => 'term_id', 
								'operator' => 'LIKE', ), 
							);
							$args['tax_query'] = array($taxo_arg);
							
							$post2 = get_posts($args);

							if($post2){ 
					?>

  <h2 class="accordion-header ">
    <a href=""><?php echo $termNivel2->name; ?></a>
  </h2>
  <div class="accordion-content">
    <ul class="icons longarrowlist">
      <?php foreach ($post2 as $terminoNivel3): ?>
      <li>
        <a href="<?php the_sub_field('link_de_items'); ?>">
          <b class="colortext">
												<?php echo $terminoNivel3->post_title; ?>
												</b>
        </a>
      </li>
      <?php endforeach ?>
    </ul>
  </div>
  <?php }else{ ?>
  <h2 class="accordion-header ">
    <a href=""><?php echo $termNivel2->name; ?></a>
  </h2>
  <?php } 
						}
					} ?>

</div>
    
asked by MarianoF 12.04.2018 в 03:55
source

0 answers