The most appropriate use for get_homepage_categories is to create an array of news categories that have been assigned to appear on the homepage.



<?php if (function_exists('get_homepage_news_categories')) $categories = get_homepage_news_categories() ?>



 No parameters are accepted



Retrieve the homepage category and output each categories name and URL

if (function_exists('get_homepage_news_categories')) $categories = get_homepage_news_categories()
foreach ($categories as $category) : 

     /* Output the category name 
     echo $category->name; 

     /* Output the category URL 
     echo get_term_link($category)




The fields returned are:



(string) The name of the category



(string) The ID of the term in the terms table (categories are stored as a taxonomy in WordPress)



(string) Unique ID for the term + taxonomy pair



(string) ID of this categories parent



(string) Number of articles in this category at last count



(string) Slug for the category



(string) Description of the category – as defined within the WordPress admin panel for this news category



(string) Name of the taxonomy for this category, this will be ‘news_category’



(string) Order defined by the admin in the admin panel for this category. Mainly used for ordering the news homepage when the admin chooses to show this category on the news homepage.

Web Statistics