Make WordPress Core

Opened 5 months ago

Closed 4 months ago

Last modified 4 months ago

#64159 closed defect (bug) (fixed)

Live Preview Button missing for block themes

Reported by: ninomiho's profile ninomiho Owned by: westonruter's profile westonruter
Milestone: 6.9 Priority: normal
Severity: normal Version: 6.8.3
Component: Themes Keywords: has-patch needs-testing has-test-info
Focuses: ui Cc:

Description

This is a follow-up to #54578.

In #54578, the Live Preview button was removed from a couple of places for block themes since the site editor preview was not working when previewing from classic themes. It was decided to remove the Live Preview button from block themes until it was implemented in Gutenberg (https://github.com/WordPress/gutenberg/issues/37201) to enable the site editor for non-active block themes. That feature has been implemented, and now Live Preview works for block themes. We should show the Live Preview button for block themes again.

Steps:

  1. Install a block theme like TwentyTwentyFive
  2. Go to Appearance -> Themes
  3. Click on the TwentyTwentyFive theme
  4. There is only the Active button instead of having Live Preview and Active
  1. Upload a block theme like TwentyTwentyFive
  2. After the theme is uploaded, there is no Live Preview button

Attachments (3)

2025-11-05_16-38.png (270.8 KB) - added by praful2111 4 months ago.
Screenshot from 2025-11-05 16-31-32.png (514.7 KB) - added by dhruval04 4 months ago.
Xnip2025-11-07_17-43-04.jpg (895.0 KB) - added by mlaetitia1986 4 months ago.
Side by side - before & after

Download all attachments as: .zip

Change History (15)

#1 @matt
4 months ago

Would love to see this fixed.

This ticket was mentioned in PR #10469 on WordPress/wordpress-develop by @ninomiho.


4 months ago
#2

  • Keywords has-patch added

What this changes

  • Shows “Live Preview” for inactive block themes on Themes and Add Themes screens.

How to test
1) Install Twenty Twenty-Five, keep it inactive → Appearance → Themes → Details → “Live Preview” is present.
2) Click it → Site Editor opens with ?wp_theme_preview=<stylesheet>.
3) Upload a block theme zip → success card shows “Live Preview” and behaves as above.
4) Classic themes still preview via the Customizer.

Trac ticket: https://core.trac.wordpress.org/ticket/64159

#3 @ninomiho
4 months ago

  • Keywords needs-testing added

PR opened: https://github.com/WordPress/wordpress-develop/pull/10469

Restores the Live Preview button for non-active block themes (as per the ticket).

Testing instructions:

1) Install Twenty Twenty-Five, keep it inactive → Appearance → Themes → Details → “Live Preview” is present.
2) Click it → Site Editor opens with ?wp_theme_preview=<stylesheet>.
3) Upload a block theme zip → success card shows “Live Preview” and behaves as above.
4) Classic themes still preview via the Customizer.

#4 @praful2111
4 months ago

  • Keywords has-test-info added

Test Report

Description

The issue is fixed with the PR mentioned below.

PR tested: https://github.com/WordPress/wordpress-develop/pull/10469

Environment

  • WordPress: 6.9-beta3-20251105.102621
  • PHP: 7.4.31-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.40.1)
  • Browser: Chrome 141.0.0.0
  • OS: Linux
  • Theme: Twenty Eleven 4.9
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with a PR.

#5 @dhruval04
4 months ago

Test Report

Description

The issue is fixed

PR tested: https://github.com/WordPress/wordpress-develop/pull/10469

Environment

  • WordPress: 6.9-beta3-20251105.102621
  • PHP: 8.4
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.40.1)
  • Browser: Chrome 131.0.6778.108
  • OS: Linux
  • Theme: Twenty Twenty-Three
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

✅ Issue resolved with a PR.

Last edited 4 months ago by dhruval04 (previous) (diff)

@mlaetitia1986
4 months ago

Side by side - before & after

#6 @mlaetitia1986
4 months ago

Just adding some screenshots of the feature test.

Steps:

  1. Head to WP Admin -> Appearance -> Themes -> Add theme
  2. Choose a Block theme , install it but do not activate it
  3. Open Appearance -> Themes -> newly installed theme -> Details & preview

Before the fix, Live Preview button wasn't visible and it is after the fix.

(note: tested in playground).

Before & after:

https://core.trac.wordpress.org/attachment/ticket/64159/Xnip2025-11-07_17-43-04.jpg

#8 @ellatrix
4 months ago

  • Milestone changed from Awaiting Review to 6.9

#9 @westonruter
4 months ago

  • Owner set to westonruter
  • Status changed from new to reviewing

#10 @westonruter
4 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 61195:

Themes: Restore 'Live Preview' button for block themes.

Note that the return query parameter is not yet functional in the Site Editor. See Gutenberg#47934.

Follow-up to [52341], [52346], [52353], [52802].

Props ninomiho, mcsf, dhruval04, praful2111, mlaetitia1986.
See #54578.
Fixes #64159.

@ellatrix commented on PR #10469:


4 months ago
#11

Thanks @westonruter!

#12 @mcsf
4 months ago

That was fast — thank you, @westonruter and @ellatrix!

#13 @ninomiho
4 months ago

Thank you everyone!

Note: See TracTickets for help on using tickets.