• Resolved pcmaple

    (@pcmaple)


    Nelio External Featured Image Not compatible with my theme Fashionista, I do not have the ” the_post_thumbnail ” code, the code that appears is wp_get_attachment_url(get_post_thumbnail_id()), help me not image appears

    There’s a file in framework folder named “function.php” there’s a code which I think needs to be edited. I have tried everything, but couldn’t make it work.

    //add thumbnails to post view
    add_filter('manage_posts_columns', 'wpex_thumbnail_column', 5);
    add_action('manage_posts_custom_column', 'wpex_custom_thumbnail_column', 5, 2);
    if( ! function_exists('wpex_thumbnail_column')) {
    	function wpex_thumbnail_column($defaults){
    		$defaults['wpex_post_thumbs'] = __('Thumbs','wpex');
    		return $defaults;
    	}
    }
    
    if( ! function_exists('wpex_custom_thumbnail_column')) {
    	function wpex_custom_thumbnail_column( $column_name, $id ){
    		if( $column_name != 'wpex_post_thumbs' )
    			return;
    			if(has_post_thumbnail()) {
                           echo '<img src="'. aq_resize( wp_get_attachment_url(get_post_thumbnail_id()), 80, 80, true ) .'" />';
    		} else { echo '-'; }
    	}
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pcmaple

    (@pcmaple)

    and i found another associated file, but i still didnot know how to fix the problem,

    <?php
    /**
     * @package WordPress
     * @subpackage Fashionista WordPress Theme
     */
    
    if( ! function_exists( 'wpex_entry_thumbnail' ) ) {
    	function wpex_entry_thumbnail() { ?>
    		<?php
    		if( !has_post_thumbnail() ) {
    			return;
    		}
    		// Overlay Icon
    		$url = get_permalink();
    		$overlay_icon = 'fa fa-plus';
    		$extra_classes = '';
    		$format = get_post_format();
    		if ( 'gallery' == $format ) {
    			$overlay_icon ='fa-picture-o';
    		} elseif ( 'audio' == $format ) {
    			$overlay_icon ='fa-music';
    		} elseif ( 'link' == $format ) {
    			$url = get_post_meta( get_the_ID(), 'wpex_post_url', true ) ? get_post_meta( get_the_ID(), 'wpex_post_url', true ) : get_the_permalink();
    			$overlay_icon ='fa-link';
    		} elseif ( 'image' == $format ) {
    			$url = wp_get_attachment_url( get_post_thumbnail_id() );
    			$extra_classes = 'fancybox';
    			$overlay_icon ='fa-arrows-alt';
    		} ?>
    		<a href="<?php echo $url; ?>" title="<?php the_title(); ?>" class="loop-entry-img-link <?php echo $extra_classes; ?>">
    			<img src="<?php echo aq_resize( get_the_post_thumbnail() ), wpex_img_size( 'entry', 'width' ), wpex_img_size( 'entry', 'height' ), wpex_img_size( 'entry', 'crop' ) ); ?>" alt="<?php echo the_title(); ?>" />
    			<div class="entry-overlay"><span class="fa <?php echo $overlay_icon; ?>"></span></div>
    		</a>
    	<?php }
    }
    Plugin Author David Aguilera

    (@davilera)

    Hi!

    Well, you’ve done the most difficult part: you’ve already identified which parts of your theme “print” a featured image. The only thing you need to do is replace the default src attribute in those img tags and use the URL of the external featured image.

    For instance, the first snippet has the following statement:

    
    echo '<img src="'. aq_resize( wp_get_attachment_url(get_post_thumbnail_id()), 80, 80, true ) .'" />';
    

    which prints a featured image. Well, try to do the following:

    
    if ( function_exists( 'uses_nelioefi' ) && uses_nelioefi( get_the_ID() ) ) {
      the_post_thumbnail( array( 80, 80 ) );
    } else {
      echo '<img src="'. aq_resize( wp_get_attachment_url(get_post_thumbnail_id()), 80, 80, true ) .'" />';
    }
    

    This function will check if the current post (get_the_ID()) has an external featured image and, if it does, it’ll print it using the_post_thumbnail.

    I hope this helps you!

    Regards,
    David

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Plugin Not Working On Fashionista Theme’ is closed to new replies.