Support » Plugin: Category Sticky Post » Throws a PHP notice

  • Hey Tom,

    $post->ID will be null on an archive page, so the plugin throws an error.

    if ( is_archive() && '1' !== get_post_meta( $post->ID, 'category_sticky_post_border', true ) ) {
    	wp_enqueue_style( 'category-sticky-post', plugins_url( '/category-sticky-post/css/plugin.css' ) );
    } // end if

    I don’t see this plugin hosted on Github so can’t make a PR. You could loop through all posts and stop once you find a post that meets the condition but it might be bad for performance. Maybe just load it anyway? Developers can always deregister it.

  • The topic ‘Throws a PHP notice’ is closed to new replies.