public function frontPage( $templates ) {

		$templates = [];

		if ( ! is_home() ) {

			$custom = get_page_template_slug( get_queried_object_id() );

			if ( $custom ) {
				$templates[] = $custom;
			}

			$templates[] = 'front-page.php';
		}

		// Return the template hierarchy.
		return $templates;
	}
public function frontPage( $templates ) {

		$templates = [];

		if ( ! is_home() ) {

			$custom = get_page_template_slug( get_queried_object_id() );

			if ( $custom ) {
				$templates[] = $custom;
			}

			$templates[] = 'front-page.php';
		}

		// Return the template hierarchy.
		return $templates;
	}
public function frontPage ( $ templates ) { $ templates = [ ] ; if ( ! is_home ( ) ) { $ custom = get_page_template_slug ( get_queried_object_id ( ) ) ; if ( $ custom ) { $ templates [ ] = $ custom ; } $ templates [ ] = 'front-page.php' ; } // Return the template hierarchy. return $ templates ; }
Fix for the front page template handling in WordPress core. Its
handling is not logical because it forces devs to account for both a
page on the front page and posts on the front page.  Theme devs must
handle both scenarios if they've created a "front-page.php" template.
This filter overwrites that and disables the `front-page.php` template
if posts are to be shown on the front page.  This way, the
`front-page.php` template will only ever be used if an actual page is
supposed to be shown on the front.

Additionally, this filter allows the user to override the front page
via the standard page template.  User choice should always trump
developer choice.

@since  5.0.0
@access public
@param  array   $templates
@return array
Fix for the front page template handling in WordPress core . Its handling is not logical because it forces devs to account for both a page on the front page and posts on the front page . Theme devs must handle both scenarios if they ve created a front - page . php template . This filter overwrites that and disables the front - page . php template if posts are to be shown on the front page . This way the front - page . php template will only ever be used if an actual page is supposed to be shown on the front .