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

    (@davilera)

    Hi! You’re almost there (hopefully). As you can see, the featured image is being retrieved from your WordPress site using the following function:

    get_post_thumbnail_id

    and it’s printed using the following code:

    if ( $image_id ) {
      echo '<img src=... />'; // The actual image here
    } else {
      echo '<img src=... />'; // A "no-cover" image here
    }

    You simply need to call Nelio first, check if the post has an external featured image and, if it does, using it:

    if ( function_exists( 'uses_nelioefi' ) &&
         uses_nelioefi( $post->ID ) ) {
      $src = nelioefi_get_thumbnail_src( $post->ID );
      echo '<img src="' . $src . '" alt="' . get_the_title() . '" />';
    } else {
      // This is the previous block:
      if ( $image_id ) {
        echo '<img src=... />';
      } else {
        echo '<img src=... />';
      }
    }

    and that’s it! If the current post ($post->ID) uses Nelio, we’ll get the link of the featured image (nelioefi_get_thumbnail_src) and we’ll print an img tag using it. Otherwise (i.e., if it doesn’t use Nelio), we’ll use the regular code.

    I hope this helps! And, please, don’t forget to rate our plugin.

    Thread Starter elp@

    (@elp-1)

    no, it not solved. the image still does not appear

    <img src alt=”Flames top Jets in long shootout to snap six-game skid”>

    🙁

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

The topic ‘Dont' work with Today theme’ is closed to new replies.