I have wordpress site and set login page as static front page. If I go to theme customizer exactly it will use front page to show site live preview. How to change page live preview to another page? In this case I will use post page as live preview page in customizer.

1 Answer
1

The default URL being previewed is home_url( "https://wordpress.stackexchange.com/" ). When no url query parameter is present when opening customize.php, this is the preview URL that is used. You can override the previewed URL when there is no url query parameter to supply a different default using something like this:

add_action( 'customize_controls_init', function() {
    global $wp_customize;
    if ( ! isset( $_GET['url'] ) ) {
        $wp_customize->set_preview_url( get_permalink( 1 ) );
    }
} );

Leave a Reply

Your email address will not be published. Required fields are marked *