admin管理员组文章数量:1130349
This is an unusual situation where I have a MU installation where one of the network sites is as actually a widget, and therefore the page contains only javascript in a document write statement.
The problem is when you load attempt to use the customizer the javascript on the page is wiping everything else.
I'm wondering:
- if I can disable live preview completely
- or if I can make the customizer start on a different, dummy page, instead of the homepage
- if there's a way to override the visible page in the query parameters
- if there's some other way to access theme_mod settings via the dashboard (current I'm having to use phpMyAdmin and edit JSON by hand – this is a WPEngine installation…)
home_url() in wp-admin/customize.php seems to be hardcoded, but I may be missing something.
This is an unusual situation where I have a MU installation where one of the network sites is as actually a widget, and therefore the page contains only javascript in a document write statement.
The problem is when you load attempt to use the customizer the javascript on the page is wiping everything else.
I'm wondering:
- if I can disable live preview completely
- or if I can make the customizer start on a different, dummy page, instead of the homepage
- if there's a way to override the visible page in the query parameters
- if there's some other way to access theme_mod settings via the dashboard (current I'm having to use phpMyAdmin and edit JSON by hand – this is a WPEngine installation…)
home_url() in wp-admin/customize.php seems to be hardcoded, but I may be missing something.
1 Answer
Reset to default 2Yes, there is a way to disable the Live Preview rendering.
1] Open your theme's functions.php file.
2] Append the following code snippet at the very end of the file:
add_action( 'customize_preview_init', function() {
die("The customizer is disabled. Please save and preview your site on the frontend.");
}, 1);
3] Save your functions.php file.
That's it. I've tested it and it works without issue.
Source: https://snippets.khromov.se/disabled-wordpress-customizer-preview/
This is an unusual situation where I have a MU installation where one of the network sites is as actually a widget, and therefore the page contains only javascript in a document write statement.
The problem is when you load attempt to use the customizer the javascript on the page is wiping everything else.
I'm wondering:
- if I can disable live preview completely
- or if I can make the customizer start on a different, dummy page, instead of the homepage
- if there's a way to override the visible page in the query parameters
- if there's some other way to access theme_mod settings via the dashboard (current I'm having to use phpMyAdmin and edit JSON by hand – this is a WPEngine installation…)
home_url() in wp-admin/customize.php seems to be hardcoded, but I may be missing something.
This is an unusual situation where I have a MU installation where one of the network sites is as actually a widget, and therefore the page contains only javascript in a document write statement.
The problem is when you load attempt to use the customizer the javascript on the page is wiping everything else.
I'm wondering:
- if I can disable live preview completely
- or if I can make the customizer start on a different, dummy page, instead of the homepage
- if there's a way to override the visible page in the query parameters
- if there's some other way to access theme_mod settings via the dashboard (current I'm having to use phpMyAdmin and edit JSON by hand – this is a WPEngine installation…)
home_url() in wp-admin/customize.php seems to be hardcoded, but I may be missing something.
1 Answer
Reset to default 2Yes, there is a way to disable the Live Preview rendering.
1] Open your theme's functions.php file.
2] Append the following code snippet at the very end of the file:
add_action( 'customize_preview_init', function() {
die("The customizer is disabled. Please save and preview your site on the frontend.");
}, 1);
3] Save your functions.php file.
That's it. I've tested it and it works without issue.
Source: https://snippets.khromov.se/disabled-wordpress-customizer-preview/
本文标签: Theme customizerpossible to disable Live Preview
版权声明:本文标题:Theme customizer - possible to disable Live Preview? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749160118a2325251.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论