1. Nelio External Featured Image

     

    Apparently, your theme uses the method called get_image of the classtd_module_single (file includes/modules/td_module_single.php) for inserting featured images. If you modify that method and include the following piece of code*:

    //do not show the featured image if...
    if (td_util::get_option('tds_show_featured_image') == 'hide' and get_post_format($this->post->ID) != 'video') {
      return;
    }
    
    /* NELIO EDIT (line 213) */
    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( $this->post->ID ) ) {
      echo nelioefi_get_html_thumbnail( $this->post->ID, $thumbType );
      return;
    }
    /* END OF NELIO EDIT */
    
    //handle video post format
    if (get_post_format($this->post->ID) == 'video') {

    the featured image should be visible! Please, let us know if this works.

    Keep in mind that any edit you perform in your theme will be lost when the plugin is updated. In order to solve is, either you add this tiny piece of code after the updates or you create a child theme (which in this case is not trivial).

    * The only piece of code relevant is the “NELIO EDIT”. The other lines are already in the method; we just put them here for context.

  2. Vinay Desai
    Member
    Posted 1 year ago #

    hi,
    i added extra code (on line 213) as you said but still its now showing featured images..
    s25.postimg.org/c1lw00ffj/Newsmag.jpg

    Im using Homepage style 3 from “Template Option”

    and here is the same homepage of my older posts (when im not using our external image plugin) i.e default featured images.
    s25.postimg.org/3xid90ie7/converted_b55ab137.jpg

    Please help me to solve this issue. 🙂
    Thanks!

  3. Nelio Software
    Member
    Plugin Author

    Posted 1 year ago #

    Hi! I see; this other template option uses a different piece of code for inserting the featured image. Try adding the following piece of code in a method called get_image, which is in file includes/wp_booster/td_module.php line 279:

    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( $this->post->ID ) ) {
      $buffy .= get_the_post_thumbnail( $this->post->ID, array(180,120) );
    }
    else {
      $buffy .= '<img width="' . $td_temp_image_url[1] /* ... */ . '/>';
    }

    Note that the code in the else part is a line that was already in your theme. That line is the one that’s inserting the featured image. If the current post is using an external featured image (first part of the if clause), then the image we print in $buffy is the external featured image. If it’s not, then we use the theme’s regular code.

  4. Vinay Desai
    Member
    Posted 1 year ago #

    hi
    followed as you say but got an error on website :
    Parse error: syntax error,
    unexpected end of file, expecting
    function (T_FUNCTION) in /****/****/public_html/wp-content/themes/Newsmag/includes/wp_booster/td_module.php on line 404

    please help… :/

  5. Nelio Software
    Member
    Plugin Author

    Posted 1 year ago #

    This error means you didn’t copy the code properly. Make sure all the brackets ({ and }) are properly placed, that no parenthesis are missing, and that the $buffy .= '<img width.../>'; instruction (which was already in your code) is properly inserted in theelse statement. Double check your code; the error is there.

Source: WordPress › Support » Not working with Newsmag theme.. 🙁

NO COMMENTS

LEAVE A REPLY