Support » Plugin: Custom Taxonomy Order » not working with my Custom query

  • hello, i have a query to get all categories then display all posts in each term
    the plugin was working 100% before i create Parent/Child categories.

    could you help me where i should put this code ? ‘orderby’ => ‘term_order’, ‘order’ => ‘ASC’

    	//show duplicates
    $do_not_duplicate = array(
    //get all categories then display all posts in each term
    $taxonomy = 'category';
    $param_type = 'category__in';
    $terms = get_terms($taxonomy,$term_args);
    if ($terms) {
            $counter = 1;
      foreach( $terms as $term ) {
          'post__not_in'     => $do_not_duplicate,
          'connected_type' => 'post_to_event',
          'connected_items' => get_queried_object(),
          "$param_type" => array($term->term_id),
          'nopaging' => true,
          'post_type' => 'post',
          'post_status' => 'publish,draft',
          'posts_per_page' => -1,
          'caller_get_posts'=> 1
        $my_query = null;
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
    	$do_not_duplicate[] = get_the_ID();	
    <h1><?php echo $term->name;?></h1>
         if( $my_query->have_posts() ) {
        while ($my_query->have_posts()) : 
            $post_id = get_the_ID();
            if (in_array($post_id, $do_not_duplicate)) {
                continue; // We've already seen this post ID, so skip the rest of the loop
    	  if (p2p_get_meta(get_post()->p2p_id, 'couples', true) == '1') $cat_invitees+= 2;
    	  else $cat_invitees++;
            $do_not_duplicate[] = $post_id;
          <?php include (TEMPLATEPATH . '/contactfullname.php'); ?> - <?php echo get_post_meta($post->ID, 'ecpt_position', true); ?>
    	  <?php $counter++; ?>
          } ?>
    <?php echo $cat_invitations ;?>
    			<?php echo $cat_invitees ;?>
     } wp_reset_query();  // Restore global post data stomped by the_post(). ?>	
     Number of invitations: <?php echo $total_invitations; ?>
     Number of Invitiess<?php echo $total_invitees; ?>
Viewing 1 replies (of 1 total)
  • Plugin Author Marcel Pol


    Hi, this code does work for me in standard categories.
    I don’t use the Types or Post 2 Posts plugin.
    You are sure you selected the right option for term-order in categories? It should be set to custom order.

    You shouldn’t need to add any parameter to get_terms(), it should just order them automatically.

    What happens when you disable other plugins? Are there other plugins that add a term_order parameter to get_terms $args?

Viewing 1 replies (of 1 total)
  • The topic ‘not working with my Custom query’ is closed to new replies.