Hi,
I have a FAQ on a website, that outputs categories of a custom taxonomy, and it works well… until i noticed something. If the category NAME has non-english letters (swedish site so has å,ä,ö) and if i use spaces in the name the posts of the category won’t be output on the page, just the category name.
When I create a category i choose a category name, and a permalink, example: “Försäkring” gets the permalink “forsakring”, and I guess I have to get the posts by this one instead of the actual name. However I don’t know how to adjust my code for it.
Here it is:
<?php $categories = get_categories( array('taxonomy' => 'faq-category') ); ?>
<?php foreach ( $categories as $category ) :
$cat_name = $category->name; ?>
<div class="row">
<div class="large-12 columns">
<h2><?php echo $cat_name ?></h2>
</div>
<div class="large-12 columns faq-columns">
<?php query_posts( array( 'post_type' => 'questions', 'faq-category' => $cat_name ) );
if (have_posts()) : while (have_posts()) : the_post(); ?>
.......
<?php endwhile; endif; wp_reset_query(); ?>
</div>
</div>
<?php endforeach; ?>