Order Categories by Hierarchy?

I did! I found a function to make option value=”slug”. The function: class SH_Walker_TaxonomyDropdown extends Walker_CategoryDropdown{ function start_el(&$output, $category, $depth, $args) { $pad = str_repeat(‘ ’, $depth * 3); $cat_name = apply_filters(‘list_cats’, $category->name, $category); if( !isset($args[‘value’]) ){ $args[‘value’] = ( $category->taxonomy != ‘category’ ? ‘slug’ : ‘id’ ); } $value = ($args[‘value’]==’slug’ ? $category->slug : $category->term_id … Read more

Adding a Custom Field to be used by Posts 2 Posts

Not sure if you really need to use the custom admin boxes, unless you need to customize labels, etc… <?php function my_connection_types() { // Make sure the Posts 2 Posts plugin is active. if ( !function_exists( ‘p2p_register_connection_type’ ) ) return; p2p_register_connection_type( array( ‘name’ => ‘cpt1_to_cpt2’, ‘from’ => ‘cpt1’, ‘to’ => ‘cpt2’, ‘admin_box’ => ‘from’, ‘fields’ … Read more

Custom category URL not displaying posts

First check if custom post type + taxonomy archive displaying correct posts by visiting a url structure like this – mysite.com/?post_type=products&products-category=monitors If it’s working then you can do some custom rewrite rules to show them just like you want. Here are some recommended answers on WPSE describing same Mixing custom post type and taxonomy rewrite … Read more

Hide directly viewing content for custom post type

register_post_type allows you to specify whether a post is ‘publicly_queryable’ publicly_queryable (boolean) (optional) Whether queries can be performed on the front end as part of parse_request(). Default: value of public argument Note: The queries affected include the following (also initiated when rewrites are handled) ?post_type={post_type_key} ?{post_type_key}={single_post_slug} ?{post_type_query_var}={single_post_slug} It doesn’t mention anything about queries of the … Read more