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

    (@nelio)

    Hi Ambrosio! Thanks for contacting us and for using our plugin; it’s always nice to see so many of you benefit from it!

    Regarding your question, our plugin does not work because the theme does not use WordPress built-in function the_post_thumbnail to output the image, but others (for a more detailed explanation, take a look at another answer I provided on the same topic).

    How to fix the problem? Well, if you look for all the calls to function get_image_url, you’ll realize that it’s being used as follows:

    <img class="thumbim" src="<?php bloginfo('stylesheet_directory'); ?>/timthumb.php?src=<?php get_image_url(); ?>&h=70&w=90&zc=1" alt=""/>

    Note that the image URL is not being inserted directly as the src attribute of an img tag. Instead, the image source is a link to a PHP script called timthumb.php that generates thumbnails for a given URL. The size of the thumbnail are specified via the attributes w (width, in the example 90) and h (height, in the example 70).

    In order to solve the issue, simply add the following code:

    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( get_the_ID() ) ):
      the_post_thumbnail( array( {WIDTH}, {HEIGHT} ) );
    else: ?>
      <img ...timthumb.php?src=<?php get_image_url(); ?>... />
    <?php
    endif;
    ?>

    around each img tag that contains a call to get_image_url. <srong>But be careful! You’ll have to set up the proper {WIDTH} and {HEIGHT} values.

    In particular, you’ll have to edit the following file:lines:

    archive.php:47 -> array(290,120)
    index.php:18   -> array(290,120)
    tabs.php:18    -> array(90,70)
    tabs.php:40    -> array(90,70)
    tabs.php:63    -> array(90,70)

    I hope this helps you!

    Thread Starter ambrosio19

    (@ambrosio19)

    Thank you so much.

    It works perfectly.

    Plugin Author Nelio Software

    (@nelio)

    Glad to hear! Enjoy the plugin and don’t forget to rate it/comment!

    Dear Plugin Anthor,
    Thank you for your plugin, i had used it at my wordpress site, but it doesn’t work, i used MesoColumn theme.
    Could you pls give me any solution?
    Looking forward to your reply.

    Best Regards
    Thanks

    Plugin Author Nelio Software

    (@nelio)

    Hi there!

    Thanks for using our plugin. Fortunately, this theme has just a few functions that insert the featured image (under functions.php). So, essentially, this is what you have to do.

    Look for the string has_post_thumbnail in functions.php. You’ll see it appears four times, in lines 578, 620, 662, and 687. We’re only interested in the first two appearances.

    In lines 579 and 621 there’s a return statement. Replace both statements (one in each line) for the following alternative statement:

    return get_the_post_thumbnail( $post->ID, array( $width, $height ), array( 'class' => $class ) );

    This other return statement will insert the featured image properly.

    Another important thing: note that these changes will be reverted if you update the theme. In order to prevent this from happening, you may want to create a child theme. In the child theme, you simply need to redefine the functions that contain those return statements: dez_get_featured_post_image and dez_get_featured_slider_image.

    Please let us know if it worked!

    Thank you so much for your quick reply, sorry to trouble you at weekend.

    After tested, it works in homepage’s category list and can click image to enter target post/page, but it doesn’t work in 3 places as below:

    1.The Homepage’s Slider: image does not appear.

    2.The Featured Categories in widget: the image appears but can’t link to the target post/page.

    3. The Related Post: SAME AS “2”

    Waiting for your response
    Have a nice weekend
    Best Regards

    Plugin Author Nelio Software

    (@nelio)

    Hi again,

    It’s quite complicated to debug all the features you’re commenting, because I have to set up a whole WordPress environment (widgets, plugins, and so on). I’ve been able to fix the issue with the Homepage Slider and the Featured Categories widget that comes with Mesocolumn. Regarding the Related Post, I don’t know the specific plugin you’re using (it looks like the theme does not include any), but I recommend you contact the Related Post plugin’s author and ask him for making it compatible with Nelio External Featured Images.

    These are the changes you have to integrate in your theme. Please note that in my previous response I asked you to change the file functions.php; the file I was talking about was lib/functions/theme-functions.php (but I assume you already guessed that).

    Again, you’ll have to edit the same lines as before. In line 579, this is the return statement you need:

    return get_the_post_thumbnail( $post->ID, array( $width, $height ), array( 'class' => $class ) );

    which is the one we used before.

    In line 621, however, we need to add two new lines, without the previous return statement. These lines are:

    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( $post->ID ) )
      $image_url = nelioefi_get_thumbnail_src( $post->ID );

    The return statement that comes after these two lines is the original return statement:

    return $before . "<img width='" . $width (...) "' />" . $after;

    After you apply these changes, just refresh your webpage. I tried it locally and everything seemed to work fine.

    Tell us if it worked!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Don′t work on Iris Theme (fabthemes.com)’ is closed to new replies.