Title: PHP Errors
Last modified: August 22, 2017

---

# PHP Errors

 *  Resolved Anonymous User 14978628
 * (@anonymized-14978628)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/)
 * Hey Stefan, hope all is well with you.
 * I’ve noticed a few errors in my debug.log and was wondering what you make of 
   them? Plugin seems to be functioning normally as far as i can tell.
 * [22-Aug-2017 05:43:36 UTC] PHP Notice: Undefined index: class in /responsify-
   wp/includes/custom_media_query_rules.php on line 58
 * [22-Aug-2017 05:43:36 UTC] PHP Notice: Undefined index: class in /responsify-
   wp/includes/custom_media_query_rules.php on line 62

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Thread Starter Anonymous User 14978628
 * (@anonymized-14978628)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/#post-9438069)
 * Looking in my debug i’ve also noticed the following errors:
 * PHP Notice: Undefined variable: post in /module-posts-blog-feed-loop.php on line
   11
    PHP Notice: Trying to get property of non-object in /module-posts-blog-feed-
   loop.php on line 11
 * which relates to this line
 * `<a href="<?php echo get_permalink( $post->ID );?>">`
 * PHP Notice: Undefined variable: post in /module-posts-blog-feed-loop.php on line
   13
 * which relates to this line
 * `$thumbnail_id = get_post_thumbnail_id( $post->ID );`
 * The previous two errors
 * [22-Aug-2017 05:43:36 UTC] PHP Notice: Undefined index: class in /responsify-
   wp/includes/custom_media_query_rules.php on line 58
 * [22-Aug-2017 05:43:36 UTC] PHP Notice: Undefined index: class in /responsify-
   wp/includes/custom_media_query_rules.php on line 62
 * Relate to this section of code:
 *     ```
       public function image_size_equals( $attributes, $value )
       	{
       		return is_integer( strpos($attributes['img']['class'], 'size-' . $value) );
       	}
       	public function image_size_not_equals( $attributes, $value )
       	{
       		return ! is_integer( strpos($attributes['img']['class'], 'size-' . $value) );
       	}
       ```
   
 * Which i recognize because i’m using custom media queries within the plugin using
   both the if equals and not equals variables for 2 separate rules.
 *  Plugin Author [stefanledin](https://wordpress.org/support/users/stefanledin/)
 * (@stefanledin)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/#post-9440126)
 * Hi Marty!
    Sorry for the late reply. I’ve noticed that the `<select>` elements
   in WordPress is a bit strange. You might have to go to your custom media queries,
   select your settings again in the `<select>` boxes and click save. Try that and
   see if the errors disappears!
 * The errors relating to `get_permalink()` and `get_post_thumbnail_id()` doesn’t
   have anything to do with RWP I think.
 *  Thread Starter Anonymous User 14978628
 * (@anonymized-14978628)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/#post-9441102)
 * Hey Stefan, no worries. Will try selecting again as you suggested and see if 
   that fixes it.
 * The other errors were part of a custom code you once gave for me manual insertion
   into the theme:
 *     ```
       <a href="<?php echo get_permalink( $post->ID );?>">
       <?php
       $thumbnail_id = get_post_thumbnail_id( $post->ID );
       echo rwp_img( $thumbnail_id, array(
           'sizes' => array('homepage-grid', 'homepage-tablet', 'homepage-phone' ),
           'attributes' => array(
               'sizes' => '(min-width: 1366px) 603px, (min-width: 1024px) 507px, (min-width: 667px) 1036px, (min-width: 568px) 603px, 507px',
       	'alt' => get_post_meta( $thumbnail_id, '_wp_attachment_image_alt', true)
           )
       ));
       ?>
       </a>
       ```
   
 * And the errors relate to these lines:
 * `<a href="<?php echo get_permalink( $post->ID );?>">`
 * `$thumbnail_id = get_post_thumbnail_id( $post->ID );`
 * From what i could find online about the error i’m getting:
 * `PHP Notice: Undefined variable: post`
 * It seems to relate to the “$post” component. Actually, just searching this again
   now i found this ([https://stackoverflow.com/questions/11520795/undefined-variable-post-php-and-mysql](https://stackoverflow.com/questions/11520795/undefined-variable-post-php-and-mysql))
   which suggests using $_POST instead of $POST. Will try that out.
 *  Plugin Author [stefanledin](https://wordpress.org/support/users/stefanledin/)
 * (@stefanledin)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/#post-9443049)
 * `$post` and `$_POST` is two different things. `$post` is a global variable in
   WordPress which contains the data of the current post, on a single page or within
   a loop for example.
    [https://codex.wordpress.org/Function_Reference/$post](https://codex.wordpress.org/Function_Reference/$post)`
   $_POST` is a global PHP variable containing data that has been posted from a 
   form.
 * `PHP Notice: Undefined variable: post` means that the code isn’t within a loop
   or on a single page. I can’t tell you any more without the whole context.
    This
   has nothing to do with RWP itself though. I might be lazy, but since it’s just
   a warning and nothing breaks, I wouldn’t worry to much about it.
 *  Thread Starter Anonymous User 14978628
 * (@anonymized-14978628)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/#post-9443515)
 * Ok, I’ve changed back Post to how it originally was. Using $_Post didn’t break
   anything, but it didn’t fix the issue either.
 * If this is just a warning and won’t break anything as you said then i’m happy
   to leave as is! Thanks!
 *  Plugin Author [stefanledin](https://wordpress.org/support/users/stefanledin/)
 * (@stefanledin)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/#post-9446619)
 * Great!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘PHP Errors’ is closed to new replies.

 * ![](https://ps.w.org/responsify-wp/assets/icon-256x256.png?rev=1209208)
 * [Responsify WP](https://wordpress.org/plugins/responsify-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/responsify-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/responsify-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/responsify-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/responsify-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/responsify-wp/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [stefanledin](https://wordpress.org/support/users/stefanledin/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/php-errors-107/#post-9446619)
 * Status: resolved