Forum Replies Created

Viewing 1 replies (of 1 total)
  • I know this post is over 4 months old, but there are still some templates out there that are non-functioning because of one little line.

    The problem arises from the file wp-includes/general-template.php where the function single_cat_title has been updated to include another requirement:

    if ( !is_category() )
                    return;

    So if the template doesn’t specifically tell the query it is a category, it will silently fail.

    In most cases simply calling $wp_query->is_category = true; BEFORE the function is called then the function will work as properly. If not, printf that was mentioned above will definitely force it to work because it won’t “echo”/”display” the title.

Viewing 1 replies (of 1 total)