• Resolved Leandro

    (@kaox00)


    Hi,@Nelio Software, Unfortunately has not worked the plugin in this theme, could you help me to solve the problem please?

    Code Example (single.php):

    if( has_post_thumbnail() ){
    		$src = wp_get_attachment_image_src( get_post_thumbnail_id(), 'maya-full', false, '' ); $src = $src[0];
    	}else{
    		$src = UN_THEME_URI.'assets/img/default.png';
    	}
    
    	$post_media = '
    	<div id="post-image" class="row" style="background-image: url(\''.$src.'\');">';

    https://www.ads-software.com/plugins/external-featured-image/

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

    (@davilera)

    Hi Leandro!

    That’s actually quite easy. If you’ve already identified where images are inserted in your theme, you simply need to tweak those locations so that the proper link is used (when needed).

    For example, the snippet you shared checks if the post has a featured image and, if it does, it uses it, and if it doesn’t, it uses a default image. Well, this is what you need to do instead:

    if ( function_exists( 'uses_nelioefi' ) &&
         uses_nelioefi( get_the_ID() ) ) {
       $src = nelioefi_get_thumbnail_src( get_the_ID() );
    } else {
    
       // Regular code for selecting feat. image:
       if ( has_post_thumbnail() ) {
          // …
       } else {
          // …
       }
    
    }
    
    $post_media='<div …' . $src . '…>';
    Thread Starter Leandro

    (@kaox00)

    It worked!, thank you my friend.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Doesn't work with theme Maya from unCommons’ is closed to new replies.