• Resolved thomaslester

    (@thomaslester)


    I′m buliding a page for booking artists using Custom Post Types UI and ACF. In the category.php I have made menu items pointing at categories set up for the Custom Post Type. But do to the danish language special characters my title and the slug (short title) of the category is not the same and no posts are rendered when pressing the Menu item “For B?rn”. It works for all the rest.

    How do I go around that?

    https://tanja3.lester-web.dk/boerneunderholdning/

    Variable:

    <?php
    		if ( is_category() ) {
    		$title = sprintf( __( '%s' ), single_cat_title( '', false ) );
    		}
    	?>

    The Loop

    <?php $loop = new WP_Query( array('post_type' => 'artister', 'category_name' => $title, 'orderby' => 'post_id', 'order' => 'ASC' )); ?>

    Any help will be deeply appreciated.

    https://www.ads-software.com/plugins/custom-post-type-ui/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘category view only works when the slug is the same as title’ is closed to new replies.