You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It’s confusing that the Preview option is still not a real preview...
I was just creating a custom template for a page. After saving the page I viewed the site and realised that what I was looking at was nothing like what I saw in the the Preview.
Note: This was the Preview in the normal block editor.
Viewing the page in the front end the custom template is used.
Here I've used the inspector to preview display on an iPad.
In order to see the Preview using the correct template for the page I needed to:
Open Site Editor
Choose Toggle Navigation
Choose Page Templates
Choose Page Template hierarchy
Choose Navigation again
Choose Templates
Choose Theme
Choose Pages
Search for the page
Choose Template Hierarchy
Toggle settings off
Then choose Preview
And the results are subtly different from the actual front end.
The text was updated successfully, but these errors were encountered:
I also noted that my custom HTML block looked a bit better if it was also switched into Preview mode.
I found this had already been suggested. See WordPress/gutenberg#23328
The subtle differences were:
Unwanted padding and margins.
Part of the difference between the Preview and View is that the site's style.css is not loaded in Preview.
Perhaps this can be improved by using editor styles.
Navigation blocks are different
Shortcodes are not expanded
The 12 step process was quite a faff. It's much easier to save and view.
From Carolina's comment WordPress/gutenberg#29398 (comment)
I was just creating a custom template for a page. After saving the page I viewed the site and realised that what I was looking at was nothing like what I saw in the the Preview.
Note: This was the Preview in the normal block editor.
Viewing the page in the front end the custom template is used.
Here I've used the inspector to preview display on an iPad.
In order to see the Preview using the correct template for the page I needed to:
And the results are subtly different from the actual front end.
The text was updated successfully, but these errors were encountered: