• My debug.log is full of PHP Notices stating:

    [25-Sep-2018 18:45:43 UTC] PHP Notice: Undefined index: media_query in \wp-content\plugins\responsify-wp\includes\style.php on line 32

    [25-Sep-2018 18:45:43 UTC] PHP Notice: Undefined index: media_query in \wp-content\plugins\responsify-wp\includes\style.php on line 35

    I believe you have the wrong examples set for rwp_style() function:
    https://github.com/stefanledin/responsify-wp

    In short: there is no ‘media_query’ but ‘media_queries’ in:

    echo rwp_style( $dynamic_header_image_ID, array(
    	'selector' => '#hero',
    	'sizes' => array('medium', 'large', 'full'),
    	'media_queries' => array(
    		'large' => 'min-width: 500px',
    		'full' => 'min-width: 1024px'
    	)
    ) );

    At the same time the code in style.php media_query() looks for:
    if ( gettype($image[‘media_query’]) == ‘array’ ) {…

    This results in a CSS code that looks like this:
    #selector {background-image: url(“image-480×360.jpg”);}
    @media screen and () {#selector{background-image: url(“image-768×480.jpg”);}}

Viewing 1 replies (of 1 total)
  • Thread Starter Ivan Privalov

    (@ivanpr)

    At the same time, the following function uses ‘media_queries’

    protected function apply_custom_media_queries( $custom_media_query )
    {
    $rwp_settings = array(
    ‘sizes’ => array( $custom_media_query[‘smallestImage’] ),
    ‘media_queries’ => array()
    );
    foreach ($custom_media_query[‘breakpoints’] as $breakpoint) {
    $rwp_settings[‘media_queries’][$breakpoint[‘image_size’]] = array(
    ‘property’ => $breakpoint[‘property’],
    ‘value’ => $breakpoint[‘value’]
    );
    $rwp_settings[‘sizes’][] = $breakpoint[‘image_size’];
    }
    $this->rwp_settings = $rwp_settings;
    }

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Notice: Undefined index: media_query in style.php’ is closed to new replies.