• Resolved NixXxon23

    (@nixxxon23)


    Hello,

    your plugin works just creat as long as you have no hierachy.

    My code for the “children” looks like this:

    $my_query = new WP_Query(array(
    	'post_type' => 'Dokumente',
    	'tax_query' => array(
    		array(
    			'taxonomy' => $taxonomyName,
    			'field' => 'slug',
    			'terms' => $term - > slug,
    		)
    	),
    	'posts_per_page' => -1,
    	'orderby' => 'menu_order', //also tried with 'term_order'
    	'order' => 'ASC', //also tried with 'DESC'
    	'paged' => $paged
    ));

    Here is a screenshot of my backend / frontend:
    https://www.directupload.net/file/d/4912/kmw8qcui_png.htm

    Hope you can help me with that?! If only the premium-version can accomplish that i would buy it but i want to be sure first (maybe you have a trial?).

    Best regards,
    Niko

    • This topic was modified 7 years ago by NixXxon23.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Maya

    (@tdgu)

    Hi,
    I think you meant to post this topic to Post Types Order forum?

    Thanks

    Thread Starter NixXxon23

    (@nixxxon23)

    Hi,

    thanks for the fast reply! It’s actually the right forum but the wrong code.

    Just realized when i read your answer.

    Here is the right Code –> And i know where the issue is but have to figure out the right code.

    $term = get_queried_object();
    $termID = $term->term_id;
    $taxonomyName = $term->taxonomy;
    $termchildren = get_term_children( $termID, $taxonomyName );   
    
    if ( !empty( $termchildren ) && !is_wp_error( $termchildren ) ){
    
    		echo '<div class="add-accordion">';
    
    		        foreach ($termchildren as $child) {             
    				$term = get_term_by( 'id', $child, $taxonomyName );
    
    					echo '<h4 style="margin-top: 1em; margin-bottom: 1em;">' . $term->name . '<span style="font-size: 11px;font-weight: 100;"> (insgesamt ' .  $term->count . ' Vorlagen)' . '</span><i class="fa fa-arrow-circle-o-right active-arrow" aria-hidden="true" style="padding-left:1em"></i></h4>';
    ...
    ....

    If you can help me, it would be great but if not i totally understand as this is not an plugin issue.

    I think i need something like:

    $args = array(
              'child_of' => $current_term->term_id,
              'orderby'  => 'menu_order',
              'order'    => 'DESC'
          );
          $terms = get_terms($taxonomyName, $args);

    Instead of my code… i guess?!

    Best,
    Niko

    • This reply was modified 7 years ago by NixXxon23.
    • This reply was modified 7 years ago by NixXxon23.
    Plugin Author Maya

    (@tdgu)

    Hi Niko,
    Yes, this is correct, you should rely on get_terms() instead as this is what plugin can work with. For all other methods including get_term_children() please consider to upgrade to Advanced taxonomy Terms Order plugin.

    Also you should use as property for ‘orderby’ ‘term_order’ instead ‘menu_order’

    Thanks

    Thread Starter NixXxon23

    (@nixxxon23)

    Thank you very much for your quick response and help and of course for the GREAT! free plugin! I managed to adapt my code to get it to work.

    I’ll talk with my customer and if there is a bit budget left I’m going to donate or buy the premium version!

    5 Star rating from me!

    Best,
    Niko

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hierachical Sort doesnt work’ is closed to new replies.