Permalink Structure problem with cpt and custom taxonomy

Welcome to WP StackExchange! You may want to try something like this, which uses the same rewrite setting as your register CPT: $args = array( ‘rewrite’ => array(‘slug’ => ‘events/ecat’, ‘with_front’ => false) ); register_taxonomy( ‘ecat’, array( ‘events’ ), $args ); Sources: https://cnpagency.com/blog/the-right-way-to-do-wordpress-custom-taxonomy-rewrites/ https://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments

How to show taxonomy meta on frontpage?

Over at Google+ I posted the same question and credits go to Alexander Conroy for coding up the correct solution: /* List all blogs, source example 2: http://codex.wordpress.org/Function_Reference/get_terms#Examples * * credits Alexander Conroy – https://plus.google.com/u/0/113053085239726972447 */ $terms = get_terms(‘blog’, $args); $blog_image_meta = get_option(‘blog_image’); if (!empty($terms)) { foreach ($terms as $term) { $meta = isset($blog_image_meta[$term->term_id]) ? … Read more

Remove description in custom taxonomy edit screen

check out this thread – I’m afraid nothing has changed since then, there is still no way of filtering the description field (it’s just html hardcoded in the file https://github.com/WordPress/WordPress/blob/master/wp-admin/edit-tags.php#L484, so you can’t remove it with php without editing the core files, which is never a right way to go). The hook you’re using, {$taxonomy}_edit_form_fields … Read more

Get used terms by an author as array of strings

I don’t know which line that error refers to but this code works correctly if everything falls into place exactly right. But there are actually several ways this could go wrong. For example, if get_query_var(‘author_name’) is not set you get an error on this line: $used_terms=list_author_used_terms($user->ID); If a problem occurs here: $terms = wp_get_object_terms( $p->ID, … Read more

Include custom post type in “all posts”

Filter pre_get_posts: add_filter( ‘pre_get_posts’, ‘wpse_98213_add_post_types_to_tax_query’ ); /** * Let WP search for custom post types on taxonomy archives. * * @wp-hook pre_get_posts * @param object $query * @return object */ function wpse_98213_add_post_types_to_tax_query( $query ) { if ( ! is_main_query() or ! is_tax( ‘your_taxonomy_name’ ) ) return $query; $query->set( ‘post_type’, array ( ‘portfolio’, ‘post’ ) ); … Read more