Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Livsy

    (@livsy)

    Here are some files from my theme:
    functions.php https://pastebin.com/pigctRh1
    single.php https://pastebin.com/UNbNLtSa

    Plugin Author David Aguilera

    (@davilera)

    Hi!

    Thanks for sharing those files but, unfortunately, they weren’t very helpful.

    If you look at the “failing” custom post types, you’ll see that the featured image is inserted within the following HTML elements:

    <div class="backstretch" ...>
      <span id="cb-media-bg"></span>
      <img ...featured-image-here...>
    </div>

    You have to take a look at your theme and look for the specific file that contains those elements (search for class="backstretch" or something like this). Once you find the file(s) using that, you should see how the theme prints the div tag, followed by an img tag, and, finally, the img tag.

    If you want to print the external featured image, you should tweak the code so that it looks similar to this:

    <div class="backstretch" ...>
      <span id="cb-media-bg"></span>
      <?php
      if ( function_exists( 'uses_nelioefi' ) &&
           uses_nelioefi( get_the_ID() ) ) {
        the_post_thumbnail();
      } else { ?>
        <img ...featured-image-here...>
      <?php
      } ?>
    </div>

    Basically, we modify the theme so that, before printing the featured image tag, it checks whether our plugin is available and, if it is, if the current post is using an external featured image. If these two checks are true, then we print the image tag using WordPress’ built-in functions. Otherwise, we use the regular image tag.

    This might need some tweaking, but that’s the basic idea you should follow.

    Regards,
    David

    Plugin Author David Aguilera

    (@davilera)

    It’s been two months without any updates. I’m marking this topic as resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘help with theme’ is closed to new replies.