Support » Fixing WordPress » Order categories by description

  • Hi everyone,

    I’m using the following code to list all categories by slug with their certain posts beneath:

    	$taxonomy = 'category';
    	$param_type = 'category__in';
    	'orderby' => 'slug',
    	'order' => 'ASC'
    	$terms = get_terms($taxonomy,$term_args);
    	if ($terms) {
    	foreach( $terms as $term ) {
    	"$param_type" => array($term->term_id),
    	'post_type' => 'post',
    	'post_status' => 'publish',
    	'posts_per_page' => -1,
    	'caller_get_posts'=> 1
    	$my_query = null;
    	$my_query = new WP_Query($args);
    	if( $my_query->have_posts() ) {  ?>
    	<h2 style="margin-bottom: 0px;"><?php echo $term->name;?>
    	while ($my_query->have_posts()) : $my_query->the_post(); ?>
    	<a>" rel="bookmark"><?php the_title(); ?></a>
    	wp_reset_query();  // Restore global post data stomped by the_post().

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    How can I alter this code in order so sort by the categories’ description and replace the category name by its description?
    I have been searching for a solution for quite a while now and I hope this does work somehow. Can you please help me?

    Thanks in advance.

  • The topic ‘Order categories by description’ is closed to new replies.