• Resolved hrvy

    (@hrvy)


    Hey,

    when using a background-image, position and repeat options are correctly displayed but the size is ignored. I’ve put in “100% 100%” (with and without semicolon) “auto auto” but it didn’t work. It isn’t inserted in the css-block.

    How can I fix it or are the values I used invalid?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter hrvy

    (@hrvy)

    I found out what the problem is: background-size isn’t inserted in the functions/dynamic-styles.php file.

    To fix it:
    Add $body_size = $body_background['background-size']; after line 210

    Replace `if ( $body_image ) {
    $styles .= ‘body { background: ‘.$body_color.’ url(‘.$body_image.’) ‘.$body_attachment.’ ‘.$body_position.’ ‘.$body_repeat.’; }’.”\n”;
    }withif ( $body_image && $body_size == “” ) {
    $styles .= ‘body { background: ‘.$body_color.’ url(‘.$body_image.’) ‘.$body_attachment.’ ‘.$body_position.’ ‘.$body_repeat.’; }’.”\n”;
    } elseif ( $body_image && $body_size != “” ) {
    $styles .= ‘body { background: ‘.$body_color.’ url(‘.$body_image.’) ‘.$body_attachment.’ ‘.$body_position.’ ‘.$body_repeat.’; background-size: ‘.$body_size.’; }’.”\n”;
    }`

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Now background-size is added to the dynamic css and background-images: cover works fine.
    Please fix it in the next release!

    Oh, good point – I had missed that that option was added in the OptionTree update. Thanks for sharing the fix.

    Thread Starter hrvy

    (@hrvy)

    Working Perfect! This theme rocks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dynamic styles – background size not working’ is closed to new replies.