Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Nelio Software

    (@nelio)

    Hi! Can you please share a link with an example where the external featured image is not working, and another link from the same blog where a regular featured image does work?

    Thanks!

    Thread Starter sarbagya

    (@sarbagya)

    Thanks for your quick reply.
    Link: http://songsforyouu.ml/

    In the ‘latest albums’, the 2nd post is regular one while 3rd one is from external link

    Plugin Author Nelio Software

    (@nelio)

    Thanks for sharing. Well, as far as I can tell from the source code, I’m afraid we have the exact same problem I’ve been discussing with another user here.

    Basically, your theme prints the <img> tag directly, instead of using a neat WordPress function called (get_)the_post_thumbnail. In order to fix the issue, you’ll have to dig into the code and find out where the image is being manually inserted, so that you can replace that “manual insert” with a call to the_post_thumbnail.

    A better option would be to contact your theme developer directly. It’s not that difficult to migrate from manual inserts to that function, and the results will be better, for us (plugin developers) will be able to hook and modify featured images.

    Alternatively, if you can’t do it yourself (or you can’t reach your theme developer), you can send us a copy of the theme (customers at Nelio Software dot com). I’ll help you find a solution πŸ˜‰

    Thread Starter sarbagya

    (@sarbagya)

    Thanks for the help, theme developer redirected me here. I am sending my theme’s copy and looking forward for your help.

    Thread Starter sarbagya

    (@sarbagya)

    Hi,
    Will you please look to these two links and tell me why the same featured is shown in link 1 but not in link 2 as post thumbnail.
    link1: http://songsforyouu.ml/hindi/khoobsurat-2014-free-mp3-songs-download/
    link2: http://songsforyouu.ml/about/

    Plugin Author Nelio Software

    (@nelio)

    Hi Sarbagya,

    There are basically two mechanisms for inserting a featured image, and we can only hook into one of them:

    • Use the (get_)the_featured_image. We can hook here and replace the featured image as we please.
    • Ask WordPress if the current post has a featured image, and if so retrieve the ID of the attachment in the media library and, with that ID, get the URL of the featured image.

    Unfortunately, I can confirm your theme is using the second approach.

    Some themes encapsulate these steps into a single function. When that occurs, we just need to edit that function and then the plugin works everywhere. Your theme, however, does not do it: the steps described in (2) are repeated all over your theme (in several files).

    How do I know where are featured images being inserted?

    Well, this is like looking for a needle in a haystack. After looking at your site, I know that we’re looking for an image tag such as <img src="..." width="..." height="..." alt="...">, where the ellipsis (…) is data printed using PHP variables.

    There are a couple of files that print such an image tag:
    extensions/content-rotator/load.php line 341
    templates/grid.php line 129

    [SOLUTION] How to fix the issue?

    My guess is that you have to edit the second one, but I’m not sure. If it’s the second one, just try adding the following piece of code after line 129:

    $media = get_the_post_thumbnail( $post->ID );

    If I’m not mistaken, this should do the trick.

    What if the featured image does not appear in other places?

    I’m afraid you’ll be encountering this issue here and there because, as I said, the code for inserting featured images is duplicated in several places of your theme. You’ll have to look for all the occurrences and fix them as they appear.

    I hope this gives you a hint on how to fix this issue. Please, let me know if this works!

    Plugin Author Nelio Software

    (@nelio)

    Hi again! In my previous entry (which is the answer I sent you via e-mail for fixing external featured images in your home page), I said:

    “What if the featured image does not appear in other places? I’m afraid you’ll be encountering this issue here and there because, as I said, the code for inserting featured images is duplicated in several places of your theme.”

    The solution I proposed only fixed the featured images inserted by the templates/grid.php file (link 1). For other pages (for instance, link 2), you’ll have to look for the specific file that inserts the featured image in that page.

    In link 2, I think the file you have to edit is templates/post.php, line 26. Try addding the following piece of code after that line:

    $media = get_the_post_thumbnail( $post->ID );

    I suppose this will fix your issue!

    Finally, I’d like to emphasize that if you encounter this issue in other pages in the future, you’ll have to look for the “offending” file yourself. As I’m sure you’ll understand, our (limited) resources make it impossible for us to find and solve all these extremely specific, theme-related issues for everybody πŸ˜‰

    Thread Starter sarbagya

    (@sarbagya)

    Thanks a lot,you are great. I got the image in link 2 also.
    But I still got one problem,the thumbnail is not showing in “Visual Composer’s Post grid” in my homepage. Will you help me sort out this one also, would be very thankful to you.

    This may help others too,who may be in the same type of problem.

    Plugin Author Nelio Software

    (@nelio)

    Glad to help! I’ll try to shed some light, here. In the following, you have a list of all the files that are (probably) inserting a featured image:

    1. data-types/radio-buttons-image.php line 88
    2. extensions/theme-utilities/theme-helpers.php line 319
    3. extensions/theme-portfolio/post-type-portfolio.php line 433
    4. extensions/content-rotator/load.php line 341
    5. extensions/content-rotator/js/jquery.content-rotator.js line 299
    6. extensions/plugin-installer/plugins/js_composer-custom.php line 373
    7. framework/libs/Html.php line 199
    8. templates/post.php line 26 (original version)
    9. templates/grid.php line 129 (original version)
    10. templates/post-audio.php line 30

    One of them is the key to success! If I had to guess, I’d say you try editing file extensions/plugin-installer/plugins/js_composer-custom.php, but I can’t tell for sure.

    On the other hand, I’d like to emphasize one more time that we do not have enough resources to help you in fixing all issues for all themes. Please note that in the plugin description we state the limitations of our plugin. The FAQ section describes how our plugin works and, specifically, its dependency with the (get_)the_post_thumbnail function, which is the function we hook into.

    The main problem here is that this kind of issues is so theme-specific, that all the (free) effort we put in fixing them benefits the users of that concrete theme solely. If you keep encountering this sort of issues, it’ll be better if you ask your theme’s developer for help.

    Thread Starter sarbagya

    (@sarbagya)

    Oh Thanks a lot…. You are a savior.
    I have to say that the support you provide is great.
    I changed the $src= (wp_get_attachment_url($custom)) ? wp_get_attachment_url($custom) : $custom; to $media = get_the_post_thumbnail( $post->ID ); and it worked.

    Plugin Author Nelio Software

    (@nelio)

    That’s fantastic! I’m really glad to hear. And I also appreciate your kind words; we try it very hard to help you as much as we can!

    Finally, please don’t forget to rate and/or comment on our plugin (and, why not, our support service). I’m sure other users will appreciate your opinion.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Thumbnails not showing in my 'vellum' theme’ is closed to new replies.