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

Page for custom taxonomy

This is a default part of the custom taxonomy functionality built into WordPress. When you register your taxonomy, the following argument play a part in determining whether to display that archive and where: public (is it accessible on the front end?) rewrite (how do the permalinks work?) You should read through all of the arguments … Read more

Taxonomy Drop Down with hierarchical view using $terms

I can kick myself, been struggling for 2 days and all that I had to do to make the wp_dropdown_categories option work is change the name to the same value as the taxonomy. My complete working code is: <?php // Equipment Category Dropdown, thanks https://gist.github.com/2902509 class Walker_SlugValueCategoryDropdown extends Walker_CategoryDropdown { function start_el(&$output, $category, $depth, $args) … Read more

Post to inherit custom category background image from parent

You can use this function to output the parent category ID and then style off of that. <?php function wpse_74737_category_top_parent_id($catid) { while ($catid) { $cat = get_category($catid); $catid = $cat -> category_parent; $catParent = $cat -> cat_ID; } return $catParent; } And then call this in your body class: <?php echo wpse_74737_category_top_parent_id( $cat->term_id ); ?>

PHP displaying wrong custom taxonomy images

I think (at least part of) the problem is that you’ve got a nested loop where you don’t really need one. The output of get_terms() is an array of objects. So $categories should be an array of objects. You loop through this array of objects here: foreach ( $categories as $category ) { $id = … Read more