Link Category Description

I’m pulling my hair out over this. In the Links manager, you can enter a description for the category (in addition to the link itself). However, in wp_list_bookmarks, there is no way to call this value anywhere. So how can I get it?

I know it’s in the term_taxonomy table, under link_category. So is there a function that could be written to retrieve this value dynamically (i.e. not having to declare each link category independently)

3 Answers
3

OK, with the help of a friend I was able to get this done. I ditched the wp_list_bookmarks and went with a combination of get_terms and get_bookmarks.

function blogroll_page( $args = array() ) {
    if(is_page('blogroll')) {
        if( $terms = get_terms( 'link_category', $args = array('exclude' => 16) ) )
        {
            foreach( $terms as $c )
            {
                printf( '<h3>%s</h3>', $c->name );
                printf( '<p>%s</p>', $c->description );

                if( $bookmarks = get_bookmarks( array( 'category' => $c->term_id ) ) )
                {
                    printf( '<ul class="xoxo bookmarks">' );
                    foreach( $bookmarks as $bm )
                        printf( '<li><a href="https://wordpress.stackexchange.com/questions/3139/%s" title="https://wordpress.stackexchange.com/questions/3139/%s">%s</a></li>', $bm->link_url, $bm->link_description, $bm->link_name );
                    printf( '</ul>' );

                }
            }
        }
    }
}

Leave a Comment