"preview-tablet customizer" Code Answer's

You're definitely familiar with the best coding language Whatever that developers use to develop their projects and they get all their queries like "preview-tablet customizer" answered properly. Developers are finding an appropriate answer about preview-tablet customizer related to the Whatever coding language. By visiting this online portal developers get answers concerning Whatever codes question like preview-tablet customizer. Enter your desired code related query in the search bar and get every piece of information about Whatever code related question on preview-tablet customizer. 

preview-tablet customizer

By Elegant ElephantElegant Elephant on Jun 11, 2020
/**
 *   Determine the device view size and icons in Customizer
 */
function wpse_20160503_adjust_customizer_responsive_sizes() {

    $mobile_margin_left = '-240px'; //Half of -$mobile_width
    $mobile_width = '480px';
    $mobile_height = '720px';

    $mobile_landscape_width = '720px';
    $mobile_landscape_height = '480px';

    $tablet_width = '720px';
    $tablet_height = '1080px';

    $tablet_landscape_width = '1080px';
    $tablet_landscape_height = '720px';

    ?>
    <style>
        .wp-customizer .preview-mobile .wp-full-overlay-main {
            margin-left: <?php echo $mobile_margin_left; ?>;
            width: <?php echo $mobile_width; ?>;
            height: <?php echo $mobile_height; ?>;
        }

        .wp-customizer .preview-mobile-landscape .wp-full-overlay-main {

            width: <?php echo $mobile_landscape_width; ?>;
            height: <?php echo $mobile_landscape_height; ?>;
            top: 50%;
            left: 50%;
            -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
        }

        .wp-customizer .preview-tablet .wp-full-overlay-main {

            width: <?php echo $tablet_width; ?>;
            height: <?php echo $tablet_height; ?>;
        }

        .wp-customizer .preview-tablet-landscape .wp-full-overlay-main {

            width: <?php echo $tablet_landscape_width; ?>;
            height: <?php echo $tablet_landscape_height; ?>;
            top: 50%;
            left: 50%;
            -webkit-transform: translate(-50%, -50%);
            transform: translate(-50%, -50%);
        }

        .wp-full-overlay-footer .devices .preview-tablet-landscape:before {
            content: "\f167";
        }

        .wp-full-overlay-footer .devices .preview-mobile-landscape:before {
            content: "\f167";
        }
    </style>
    <?php

}

add_action( 'customize_controls_print_styles', 'wpse_20160503_adjust_customizer_responsive_sizes' );

/**
 *   Set device button settings and order
 */
function wpse_20160503_filter_customize_previewable_devices( $devices )
{
    $custom_devices[ 'desktop' ] = $devices[ 'desktop' ];
    $custom_devices[ 'tablet' ] = $devices[ 'tablet' ];
    $custom_devices[ 'tablet-landscape' ] = array (
            'label' => __( 'Enter tablet landscape preview mode' ), 'default' => false,
    );
    $custom_devices[ 'mobile' ] = $devices[ 'mobile' ];
    $custom_devices[ 'mobile-landscape' ] = array (
            'label' => __( 'Enter mobile landscape preview mode' ), 'default' => false,
    );

    foreach ( $devices as $device => $settings ) {
        if ( ! isset( $custom_devices[ $device ] ) ) {
            $custom_devices[ $device ] = $settings;
        }
    }

    return $custom_devices;
}

add_filter( 'customize_previewable_devices', 'wpse_20160503_filter_customize_previewable_devices' );

Source: wordpress.stackexchange.com

Add Comment

0

All those coders who are working on the Whatever based application and are stuck on preview-tablet customizer can get a collection of related answers to their query. Programmers need to enter their query on preview-tablet customizer related to Whatever code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about preview-tablet customizer for the programmers working on Whatever code while coding their module. Coders are also allowed to rectify already present answers of preview-tablet customizer while working on the Whatever language code. Developers can add up suggestions if they deem fit any other answer relating to "preview-tablet customizer". Visit this developer's friendly online web community, CodeProZone, and get your queries like preview-tablet customizer resolved professionally and stay updated to the latest Whatever updates. 

Whatever answers related to "preview-tablet customizer"

View All Whatever queries

Whatever queries related to "preview-tablet customizer"

Browse Other Code Languages

CodeProZone