PHP Notice: Undefined index: media_query in style.php
-
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-wpIn 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”);}}
…
- The topic ‘PHP Notice: Undefined index: media_query in style.php’ is closed to new replies.