Okay
  Public Ticket #916564
Custom Logo Mobile Width Fix
Closed

Comments

  •  2
    guzenko started the conversation

    Please, fix error in your file kalium/tpls/logo.php:

    from:

    // Custom Logo Mobile Width
    if ( $custom_logo_image && $custom_logo_mobile_max_width ) {
    generate_custom_style( '.logo-image', "width: {$custom_logo_mobile_max_width}px", 'screen and (max-width: 768px)' );
    }

    to:

    // Custom Logo Mobile Width
    if ( $custom_logo_image && $custom_logo_mobile_max_width ) {
    generate_custom_style( '.logo-image', "width: {$custom_logo_mobile_max_width}px", '@media screen and (max-width: 768px)' );
    }


  • [deleted] replied

    Hi Guzenko,

    This function generate_custom_style has @media declaration optional, see how its declareted:

    function generate_custom_style( $selector, $props = '', $media = '', $footer = false ) {
    global $bottom_styles;

    $css = '';

    // Selector Start
    $css .= $selector . ' {' . PHP_EOL;

    // Selector Properties
    $css .= str_replace( ';', ';' . PHP_EOL, $props );

    $css .= PHP_EOL . '}';
    // Selector End

    // Media Wrap
    if ( trim( $media ) ) {
    if ( strpos( $media, '@' ) != 0 ) {
    $css = "@media {$media} { {$css} }";
    } else {
    $css = "{$media} { {$css} }";
    }
    }

    if ( ! $footer || defined( 'DOING_AJAX' ) ) {
    echo "{$css}";
    return;
    }

    $bottom_styles[] = $css;
    }

    So we have simplified the usage of this function. It will work in both versions.