wordpress is_front_page() issue

I am updating the page title of all pages with a function i have created:

function wpss_show_custom_description() {
    $wpss_disable = get_post_meta(get_the_id(), 'wpss_disable', true);
    $wpss_description = get_post_meta(get_the_id(), 'wpss_description', true);
    $wpss_description_auto = get_post_meta(get_the_id(), 'wpss_description_auto', true);
    if(wpss_check_post_type(get_post_type()) == 1 && $wpss_disable != 1){
        if($wpss_description){
            echo '<meta name="description" content="'.$wpss_description.'" />';
        } else {
            echo '<meta name="description" content="'.$wpss_description_auto.'" />';
        }
    }

    if(is_front_page()){
        echo '<meta name="description" content="'.$home_title.'" />';
    }
}

add_action('wp_head','wpss_show_custom_description');

Every other page works, apart from the frontpage. Is i edit the header directly and do this it works:

if(is_front_page()){
    echo '<meta name="description" content="'.$home_title.'" />';
}

Any ideas what the issue is?

Read more here: wordpress is_front_page() issue

Leave a Reply

Your email address will not be published. Required fields are marked *