Difference between wp_list_categories and get_categories

The WordPress functions get_categories() and wp_list_categories() are almost the same. They are using almost the same parameters but there is a difference between them:

  • The get_categories() function returns an array of category objects matching the query parameters.
  • The wp_list_categories() displays a list of categories as links.

WordPress developer documention:

get_categories(): http://codex.wordpress.org/Function_Reference/get_categories

wp_list_categories(): http://codex.wordpress.org/Function_Reference/wp_list_categories

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s