• Hello,

    I’m trying to do the following, output a set of div’s of all the sub-category’s of the current category on an archive page.

    Yesterday it all worked fine untill i added new subcategory’s to the system, out of the blue it stopped working. I have some doubts about my code but i really don’t get whats happening.

    So there is NO output anymore, the whole div id=categoryblock is not even being echoed anymore..

    Does any of you maybe see it?

    <?php
    
     if (is_category()) {
      $this_category = get_category($cat);
      if (get_category_children($id) != "") {
    
    	$args=array(
        'show_option_all' => '', 'orderby' => 'name',
    		'order' => 'ASC', 'show_last_update' => 0,
    		'style' => 'list',
    		'show_count' => 0,
    		'hide_empty' => 0,
    		 'use_desc_for_title' => 1,
    		'child_of' => $id,
    		'feed' => '',
    		 'feed_type' => '',
    		'feed_image' => '',
    		'parent' => $id,
    		 'exclude' => '1',
    		 'current_category' => 0,
    		'hierarchical' => true, 'title_li' => __( 'Categories' ),
    		'echo' => 1, 'depth' => 0
    
      );
     ?>
      <div id="categoryblock">
      <?php
    
    $categories=get_categories($args);
      foreach($categories as $category) {
        echo ' <div class="categoryblock"><h3> <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "Bekijk alle berichten in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </h3> ';
        echo '<p> <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "Bekijk alle berichten in %s" ), $category->name ) . '" ' . '>'. $category->description . '/a></p></div>';
         }
    echo "</div>";
      }
    }
    ?>
  • The topic ‘Output of sub category’s of on archive page’ is closed to new replies.