Make WordPress Core

Opened 10 months ago

Closed 6 weeks ago

#58914 closed defect (bug) (duplicate)

Full-site editing theme warning about missing header.php

Reported by: iulia-cazan's profile Iulia Cazan Owned by:
Milestone: Priority: normal
Severity: minor Version: 6.2.2
Component: Themes Keywords:
Focuses: Cc:

Description

When using a theme compatible with full site editing, I get this warning from time to time when the page is redirecting. This can be replicated also in WordPress 6.3-RC2-56310 running Twenty Twenty-Three theme.

Deprecated: File Theme without header.php is deprecated since version 3.0.0 with no alternative available. Please include a header.php template in your theme. in /public/wp-includes/functions.php on line 5653

Change History (3)

#1 follow-up: @rajinsharwar
10 months ago

I think, twenty twenty-three is a block theme. Can you check if using the below code resolves the warning you are getting?


if( wp_is_block_theme() ) {
    block_template_part('header');
}

if( wp_is_block_theme() ) {
    block_template_part('footer');
}

#2 in reply to: ↑ 1 @Iulia Cazan
10 months ago

Replying to rajinsharwar:

I think, twenty twenty-three is a block theme. Can you check if using the below code resolves the warning you are getting?


if( wp_is_block_theme() ) {
    block_template_part('header');
}

if( wp_is_block_theme() ) {
    block_template_part('footer');
}

Not sure I understand what you meant by that.

The theme itself does not have a header.php file at all, this is the theme structure. https://imgur.com/45G7OkU

To me, this looks like a bug, to get a warning about the theme not having a header.php file when the official theme does not have one. What am I missing?

#3 @poena
6 weeks ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #55023.

Hi,
Thank you for the report.

I am closing this ticket as a duplicate of https://core.trac.wordpress.org/ticket/55023.
Please continue any discussion there.

Note: See TracTickets for help on using tickets.