Ticket #3682: is_front.001.diff

File is_front.001.diff, 640 bytes (added by markjaquith, 5 years ago)

adds is_front() function

  • wp-includes/query.php

     
    104104        return $wp_query->is_feed; 
    105105} 
    106106 
     107// front of site, whether blog view or a WP Page 
     108function is_front () { 
     109        // most likely case 
     110        if ( 'posts' == get_option('show_on_front') && is_home() ) 
     111                return true; 
     112        elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) ) 
     113                return true; 
     114        else 
     115                return false; 
     116} 
     117 
     118 
     119// the blog view 
    107120function is_home () { 
    108121        global $wp_query; 
    109122