Support » Plugin: Real Custom Post Order: Create a custom order for your content » use Order in Template (orderby or order)

  • Resolved kopfundstift

    (@kopfundstift)


    Hi,
    i use your plugin to order my CPT. now i want to use this order in a template:
    A little snippet from my code:

    if ($catc = $term->count) {
                $termz = get_terms([
        'taxonomy' => get_queried_object()->taxonomy,
        'parent'   => $catid,    
        'order' => 'DESC', //<----------- which Expression should i use
        'orderby' => 'title', //<----------- which Expression should i use
    ]);
    echo '<ul class="catul catunder">';
                 foreach($termz as $cy) { 
    
                    echo '<li><a href="' . get_category_link( $cy->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $cy->name ) . '" ' . '>' . $cy->name.'</a> </li> ';
                 
                }
    
     }
    echo '</ul>';
            }

    se comments in code. i want to use the custom order.
    thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Matthias Günter

    (@mguenter)

    Hi @kopfundstift !

    Thanks for your message.

    Is get_queried_object()->taxonomy a hierarchical taxonomy? In general, RCPO just overwrites the order definition and always applies the manual ordering.

    Is the taxonomy, which you are fetching, also drag & drop’able in your WordPress backend by RCPO?

    Plugin Author Matthias Günter

    (@mguenter)

    Due to inactivity, I will close this ticket. Please don’t hesitate to open again! 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘use Order in Template (orderby or order)’ is closed to new replies.