• Resolved Nguy?n Vi?t Anh

    (@alexviean)


    Notice: Undefined variable: first_feat_image in /…../wp-content/plugins/external-featured-image/includes/nelio-efi-main.php on line 98

    This plugin also doesn’t work with twentyfifteen theme

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author David Aguilera

    (@davilera)

    Hi!

    Thanks for reporting the notice again; it’ll be fixed in the next release. In the meantime, just take a look at this other thread for applying the solution yourself.

    Regarding the issue with the twenty fifteen theme, that’s not possible. I use that theme in my development installation and featured images work just fine. What’s amiss in your case?

    Thread Starter Nguy?n Vi?t Anh

    (@alexviean)

    Thanks for replying.
    Sorry for not describing particularly. It’s Previous/Next Posts section at the end of every posts in twentyfifteen theme

    Plugin Author David Aguilera

    (@davilera)

    Hi!

    You’re absolutely right; in the Prev/Next posts, featured image is not visible. In order to overcome this issue, add the following function in theme’s functions.php file (or, if you have a plugin where you add your own customization, add it there):

    function nelioefi_twentyfifteen_post_nav_background() {
      if ( ! is_single() ) {
        return;
      }
    
      $previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( false, '', true );
      $next     = get_adjacent_post( false, '', false );
      $css      = '';
    
      if ( is_attachment() && 'attachment' == $previous->post_type ) {
        return;
      }
    
      if ( $previous &&  uses_nelioefi( $previous->ID ) ) {
        $css .= '
          .post-navigation .nav-previous { background-image: url(' . esc_url( nelioefi_get_thumbnail_src( $previous->ID ) ) . '); }
        ';
      }
    
      if ( $next && uses_nelioefi( $next->ID ) ) {
        $css .= '
          .post-navigation .nav-next { background-image: url(' . esc_url( nelioefi_get_thumbnail_src( $next->ID ) ) . '); border-top: 0; }
        ';
      }
    
      wp_add_inline_style( 'twentyfifteen-style', $css );
    }
    add_action( 'wp_enqueue_scripts', 'nelioefi_twentyfifteen_post_nav_background', 99 );

    Best,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error Undefined variable’ is closed to new replies.