• Resolved mrgermain

    (@mrgermain)


    Hi,

    I’m trying to set up your plugin with “Ink” template from Codestag, but it’s not working…
    I tried adding the code to CSS, with no effect.

    I’m no CSS / PHP expert, but I had a quick look at the template and I was able to found the “get_post_thumbnail_id() );” function so I suppose it should be OK to work…

    Can you help me on this one ?
    Website is available at mrgermain.fr

    Thanks !

    https://wordpress.org/plugins/external-featured-image/

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

    (@davilera)

    Hi, mrgermain!

    I don’t know how your theme works. However, I believe it’s not using the proper function. Essentially, there are two options for printing a featured image:

    1. Use the (get_)the_post_thumbnail function, or
    2. Use the functions get_post_thumbnail_id and wp_get_attachment_image_src

    Unfortunately, our plugin will only work in your theme if it uses the first option, not the second one. And, apparently, it looks like (according to what you’re saying) your theme is using the second one.

    I assume your theme is doing something like this:

    $image_id = get_post_thumbnail_id();
    $image_src = wp_get_attachment_image_src( $image_id );

    and then it’s using the image somewhere, like this: $image_src[0].

    You may simply want to add the following two new lines to fix the issue:

    $image_id = get_post_thumbnail_id();
    $image_src = wp_get_attachment_image_src( $image_id );
    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( get_the_ID() ) )
      $image_src = array( nelioefi_get_thumbnail_src( get_the_ID() ) );

    This way, we check whether the current post has an external featured image defined (uses_nelioefi) and, if it does, we obtain the appropriate link to the image (nelioefi_get_thumbnail_src). Note we have to return an array, for the original function (wp_get_attachment_image_src) returns also an array.

    I hope this makes sense! Please, let us know if it fixed your issue.

    Plugin Author David Aguilera

    (@davilera)

    Any updates?

    Plugin Author David Aguilera

    (@davilera)

    It’s been over a month since my last post. Since we had no updates from mrgermain, I’ll mark the topic as resolved!

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

The topic ‘Plugin not working with Codestag Template /’ is closed to new replies.