Div menu

============================================ ===================================================== <?php /*
    get_results(“SELECT * FROM $wpdb->terms AS wterms INNER JOIN $wpdb->term_taxonomy AS wtaxonomy ON ( wterms.term_id = wtaxonomy.term_id ) WHERE wtaxonomy.taxonomy = ‘category’ AND wtaxonomy.parent = $cati AND wtaxonomy.count > 0″); $catCounter = 0; foreach ($catQuery as $category) { //TO KNOW THE CHILD CATEGORY $children = get_terms( $category->taxonomy, array( ‘parent’ => $category->term_id, ‘hide_empty’ => false ) ); // print_r($children); // uncomment to examine for debugging if($children) { // get_terms will return false if tax does not exist or term wasn’t found. echo ” term has children”; } //TO KNOW THE CHILD CATEGORY $catCounter++; $catStyle = ”; if (is_int($catCounter / 2)) $catStyle = ‘ class=”catAlt”‘; $catLink = get_category_link($category->term_id); echo ‘
  • name.'”>’.$category->name.’

    ‘; echo ‘
      ‘; // query_posts(‘cat=’.$category->term_id.’&showposts=5′); query_posts(‘cat=’.$category->term_id.”); //query_posts(‘cat=’.$category->term_id.’post_type=department’); ?>
    • <a href="” rel=”bookmark” title=””>
    • <a href="” title=”name; ?>”>More name; ?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~“` =========================================== $year ) { /* add the heading */ $yourcat = get_category($year); $output .= sprintf( ‘

%s

‘, $yourcat->name ); /* setup current query/loop */ $args = array( ‘cat’ => $year, // ‘cat’ => get_cat_ID( $year), ‘post_type’ => ‘department’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 100, ‘caller_get_posts’ => 1, ‘depth’ => 2 //’exclude’ => 28, // ‘offset’ => 9 ); $loop = new WP_Query( $args ); /* iterate over articles */ $listItems = ”; while( $loop->have_posts() ) { $loop->the_post(); /* $listItems .= sprintf( ‘
  • %s%s%s
  • ‘, get_the_title() // get_the_date(), // get_the_content() */ $listItems .= sprintf( ‘
  • %s
  • ‘, get_the_title() // get_the_date(), // get_the_content() ); } $output .= sprintf( ‘
      %s
    ‘, $listItems ); } echo $output; ?> */ ?> =================================================================

    Leave a Reply