Category ID and Name List

<?php
//Category ID ~ Name List
function hyper_id_name_widget_function() {

$categories=get_categories('orderby=id');
foreach($categories as $category) {
echo '<p>Cat ' . get_cat_ID($category->name) . ' = <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p>';
}
}
function hyper_id_name_widget() {
wp_add_dashboard_widget('hyper_id_name_widget', 'Category ID ~ Name List', 'hyper_id_name_widget_function');
}
add_action('wp_dashboard_setup', 'hyper_id_name_widget' );

?>

0 Comments

You must be logged in to post a comment.