Custom Permalink Structure for terms/taxonomies of custom post type

Create your custom taxonomies for your custom post type and for each, set the slug to include the findby portion, as in the example below for charity. ‘has_archive’ => true, ‘rewrite’ => array( ‘slug’ => ‘findby/charity’, ‘with_front’ => false ), ‘query_var’ => true, ‘public’ => true, Create your custom post type with desired slug. ‘has_archive’ … Read more

Unsetting post_tag taxonomy breaks term description for other taxonomies

Try using this function to avoid your problem: function sld_unregister_taxonomy_from_object_type($taxonomy, $object_type) { global $wp_taxonomies; if ( !isset($wp_taxonomies[$taxonomy]) || !get_post_type_object($object_type) ) return false; foreach (array_keys($wp_taxonomies[$taxonomy]->object_type) as $array_key) { if ($wp_taxonomies[$taxonomy]->object_type[$array_key] == $array_key) { unset ($wp_taxonomies[$taxonomy]->object_type[$array_key]); return true; } } return false; } e.x.: function mwm_unregister_taxonomy(){ sld_unregister_taxonomy_from_object_type( ‘post_tag’, ‘post’ ); } add_action( ‘init’, ‘mwm_unregister_taxonomy’);

Taxonomy or Custom Field

I’m not sure why an Author post-type has a “title” taxonomy, unless you meant books or something, or even why you can’t use the built-in published date field, but here goes: Store the date published as a timestamp in a custom field. You can do the conversions behind the scenes and just show users the … Read more

Set post terms by term id

When dealing with this, it turned out that the $parent var had to be casted as an int. Looking at the function wp_set_object_terms, it tests the param $parent with is_int(). The var $parent was coming from $_POST which was sent though http post using ajax. Somewhere along the way, probably on the javascript side, my … Read more

Display Child Categories of Current Post ID

For actual categories: <ul> <?php global $post; // grab categories of current post $categories = get_the_category($post->ID); // define arguments of following listing function $args = array ( ‘child_of’ => $categories[0], // current post’s (first) category ‘title_li’ => ” // disable display of outer list item ); // list child categories wp_list_categories($args); ?> </ul> The same … Read more