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.

Share Improve this question asked Dec 2, 2015 at 0:21 William TurrellWilliam Turrell 7746 silver badges18 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Yes, 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.

Share Improve this question asked Dec 2, 2015 at 0:21 William TurrellWilliam Turrell 7746 silver badges18 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Yes, 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