Make WordPress Core


Ignore:
Timestamp:
01/27/2017 10:08:37 PM (10 years ago)
Author:
davidakennedy
Message:

Bundled Themes: Allow category display in post preview even when only one category

The category is not shown in the preview. And because of how themename_categorized_blog() function in each theme returns false for 1 or fewer categories, and in this case it won't show the new category.

The patch uses is_preview() to fix that in Twenty Fourteen, Fifteen and Seventeen.

Props lancewillett.

Fixes #39531.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/inc/template-tags.php

    r31482 r40023  
    141141        }
    142142
    143         if ( 1 !== (int) $all_the_cool_cats ) {
     143        if ( $all_the_cool_cats > 1 || is_preview() ) {
    144144                // This blog has more than 1 category so twentyfourteen_categorized_blog should return true
    145145                return true;
Note: See TracChangeset for help on using the changeset viewer.