How to make a metabox that contains link categories?

Found the last bit. It was just a syntax error: <?php selected( $selected, “.$term_id”. ); ?> Should be… <?php selected( $selected, $term_id ); ?> Entire Function: function tf_book_deets_create(){ add_meta_box(‘tf_book_purchase’, ‘Book Purchase Links’, ‘tf_book_purchase’, ‘books’,’side’,’default’); } function tf_book_purchase (){ global $post; $custom = get_post_custom($post->ID); $link = $custom[“link”][0]; $selected = isset( $custom[‘link’] ) ? esc_attr( $custom[‘link’][0] ) … Read more

Anchor tag generates blank href attribute using echo esc_url( )

This is probably not the template for a category archive, but for a custom page template because of this: /* Template Name: Categories */ The query variable ‘cat’ is not set in pages. Move get_category_link( $id ); inside the foreach. <li><a href=”https://wordpress.stackexchange.com/questions/151716/<?php echo esc_url( get_category_link( $cat->term_id ) ); ?>”><?php echo $cat->name; ?></a></li>

Blogroll links sorted by category in a table

As suggested, here is the “arrayed” version: $args = array( ‘categorize’ => 1, ‘category_before’ => ”, ‘category_after’ => ‘</table>’, ‘title_before’ => ‘<h3>’, ‘title_after’ => ‘</h3><table><tr><th>Link</th><th>Description</th><tr>’, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘before’ => ‘<tr><td>’, ‘after’ => ‘</td></tr>’, ‘between’ => ‘</td><td>’, ‘show_description’ => 1, ‘show_name’ => 1 ); wp_list_bookmarks( $args ); The Highlight of my answer … Read more

Add Link Category on Activation?

Link category is a simple taxonomy just like categories , named: link_category so to add one you can use wp_insert_term() eg: wp_insert_term( ‘My link category’, // the term ‘link_category’, // the taxonomy array( ‘description’=> ‘this is a description.’, ‘slug’ => ‘my-link-category’ ) ); and to make all this happen on plugin activation take a look … Read more