WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Custom category Display (2 posts)

  1. westondeboer
    Member
    Posted 7 years ago #

    Is there a way to do a loop just for categories?

    I want to show the categories on the front page and thats it.

    I want to show a category image, the category description and link and some more stuff. For every category. Maybe five or six.

    Thank you so much for any help on this!

  2. westondeboer
    Member
    Posted 7 years ago #

    I am doing this old school ghetto style, which might be the only way it can be done?

    <?php
    $custocats = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
    
    foreach ($custocats as $custocat) {
    
    echo "<a href=\"/archives/category/$custocat->category_nicename\">$custocat->cat_name</a> - ";
    	echo $custocat->category_description;
    echo "<br/>";
    
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags