Remove custom taxonomy slug from URL

Why don’t you try to create a slug of your own. And then link it up to your desire things. Just use this function: function slugify($str){ $search = array(‘Ș’, ‘Ț’, ‘ş’, ‘ţ’, ‘Ş’, ‘Ţ’, ‘ș’, ‘ț’, ‘î’, ‘â’, ‘ă’, ‘Î’, ‘Â’, ‘Ă’, ‘ë’, ‘Ë’); $replace = array(‘s’, ‘t’, ‘s’, ‘t’, ‘s’, ‘t’, ‘s’, ‘t’, ‘i’, … Read more

How to list posts by terms

$terms = get_terms(‘CUSTOM_TAXONOMY’, [‘hide_empty’ => true]); foreach( $terms as $term ){ echo ‘<section>’; echo ‘<h1>’ . $term->name . ‘</h1>’; $posts = get_posts([ ‘post_type’ => ‘CUSTOM_POST_TYPE’ ‘tax_query’ => [ [ ‘taxonomy’ => ‘CUSTOM_TAXONOMY’, ‘field’ => ‘term_id’, ‘terms’ => $term->term_id ] ] ]); echo ‘<ul>’; foreach($posts as $post){ echo sprintf(‘<li><a href=”%s”>%s</a></li>’, get_permalink($post), $post->post_title); } echo ‘</ul>’; echo … Read more