Sage 9 is returning 'Latest Posts' string when Settings front page display to latest posts

/**
 * Page titles
 * @return string
 */
function title()
{
    if (is_home()) {
        if ($home = get_option('page_for_posts', true)) {
            return get_the_title($home);
        }
        return __('Latest Posts', 'sage');
    }
    if (is_archive()) {
        return get_the_archive_title();
    }
    if (is_search()) {
        return sprintf(__('Search Results for %s', 'sage'), get_search_query());
    }
    if (is_404()) {
        return __('Not Found', 'sage');
    }
    return get_the_title();
}

This is the code that controls the title output from the page-header.blade.php partial.

I noticed that WordPress was using the front-page.blade.php template over the home.blade.php template even when I manually select Home Template from the edit Page screen. It wasn’t until I deleted Front-page.blade.php that it was returning the correct titles of ever blog post.

Will front-page.blade.php template always take precedence?

If I’m understanding your qustion correctly, what you are describing is expected behavior. If your site is set to show posts on the front page, WordPress will look first for front-page.php, then home.php, and finally it will fall back to index.php

Here’s a link to the relevant section from the docs on template hierarchy.

1 Like

Right on sir! Thanks for your help. I’m trying to freshen up on the heirarchy.