Skip to content

Array variables for defining image sizes unclear #11

@shaneonabike

Description

@shaneonabike

Hey! Thanks for building such a great tool to actually make Wordpress way more responsive. This is exactly what we need to be more HTML5 compliant.

In using your plugin I am a bit confused with regards to the variables bg, srcset, sizes. Mainly, because no matter what I define them as I don't actually see them being used. I've included a snipit of my code below so you can take a look and maybe point out my errors.

So in my example here with visual-desktop the bg and srcset never are applied into the actual output. Are they needed? Should I not be defining a media in the picture tag at the start as you have in your example?

` $output = array(
'visual' => array(
'desktop' => array(
array( 1280, 9999, false ),
'picture' => '',
'bg' => '@media (min-width:1025px)',
'srcset' => '{w}w', // descriptor
'sizes' => '(min-width: 1025px) {w}px', // condition
),
'laptop' => array(
array( 1024, 9999, false ), //height:290
'picture' => '',
'bg' => '@media (min-width:769px)',
'srcset' => '{w}w',
'sizes' => '(min-width:769px) {w}px',
),
'tablet' => array(
array( 768, 9999, false ),
'picture' => '',
'bg' => '@media (min-width: 321px)',
'srcset' => '{w}w',
'sizes' => '(min-width: 321px) {w}px',
),
'mobile' => array(
array( 320, 9999, false ),
'picture' => '',
'bg' => '@media (max-width:320px)',
'srcset' => '320w',
'sizes' => '(max-width:320px) {w}px',
),
'default' => array(
array(9999,9999),
'picture' => '{alt}',
),

    ),

);
`

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions