• on category (archive.php) I use
    if (in_category(single_cat_title('', false))) {
    to display article from the actual category

    The problem appear if category name contain ‘ (apostrophe)
    it doesn’t display any post

    when a check in source I notice
    single_cat_title() replace ??’?? U+0027 by ??’?? U+2019
    So for today i quick fix by replacing my category changing ??’?? U+0027 by ??’?? U+2019
    but as you could guess is not a good way
    Even if ??’?? U+2019 is the rule for french

Viewing 3 replies - 1 through 3 (of 3 total)
  • Donot you title. its good, if you use slug of your category slug in any if condition.

    Thread Starter gotcha5832

    (@gotcha5832)

    Thanks for your answer but i’m not suret to have understand

    Do you mean to not test on title but on slug?

    Thread Starter gotcha5832

    (@gotcha5832)

    So I changed by

    	$this_category = get_category($cat);
    		// if (in_category(single_cat_title('', false))) {
    		if (in_category($this_category->slug)) {
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘problem with ‘ in category name’ is closed to new replies.