Monday, October 24, 2022

Sorting Drawback


I attempted to alter the Features.php to this code

add_filter( 'terms_clauses', 'wpse247680_terms_clauses', 10, 3 );
    perform wpse247680_terms_clauses( $items, $taxonomies, $args ) {
        // Bail if we're not trying on the proper taxonomy, 'class' on this case.
        if ( ! in_array( 'class', $taxonomies ) ) {
            return $items;
        }
    
        // Casts the time period identify to an integer
        // Thought derrived from related concept utilizing posts right here: https://www.fldtrace.com/custom-post-types-numeric-title-order
        $items['orderby'] = 'ORDER BY (t.identify+0) ';
    
        return $items;
    } 

And it did not work, what’s unsuitable? How do I determine the place to place the code in capabilities.php?
It orders them as 1,10,11,12,13…2,21,22,23,24,25. I do not wish to add 0 to 1-9 numbers. How can I repair this problem?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments