• Resolved kdurrum

    (@kdurrum)


    None of my external images show in the featured image previews for my post or pages. I have a layout that should show thumbnail previews for my post but all are empty. Based on what I have read about the issue is there needs to be a change to the theme to use a different WP command to retrieve the thumbnails. Has anyone had an issue with Cherry Framework themes?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter kdurrum

    (@kdurrum)

    I started looking around and I believe my challenge may be in the theme-function.php file. Here is what I found:

    $src = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), array( ‘9999’,’9999′ ), false, ” );
    $thumb = get_post_thumbnail_id();
    $img_url = wp_get_attachment_url( $thumb, ‘full’ ); //get img URL
    $image = aq_resize( $img_url, 700, 460, true ); //resize & crop img

    and

    // thumbnail of WP 2.9
    $thumbnail_id = get_post_meta( $post_id, ‘_thumbnail_id’, true );

    Not sure what to replace and what to replace it with.

    Thread Starter kdurrum

    (@kdurrum)

    I have narrowed my issue down to this set of code:

    $post_id        = $posts[$j]->ID;
    				setup_postdata($posts[$j]);
    				$excerpt        = get_the_excerpt();
    				$attachment_url = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'full' );
    				$url            = $attachment_url['0'];
    				$image          = aq_resize($url, $thumb_width, $thumb_height, true);
    				$mediaType      = get_post_meta($post_id, 'tz_portfolio_type', true);
    				$prettyType     = 0;
    
    				if ($count > $columns) {
    					$count = 1;
    					$output .= '<ul class="posts-grid row-fluid unstyled '. $custom_class .'">';
    				}
    
    				$output .= '<li class="'. $spans .'">';
    					if(has_post_thumbnail($post_id) && $mediaType == 'Image') {
    
    						$prettyType = 'prettyPhoto-'.$rand;
    
    						$output .= '<figure class="featured-thumbnail thumbnail">';
    						$output .= '<a href="'.$url.'" title="'.get_the_title($post_id).'" rel="' .$prettyType.'">';
    						$output .= '<img  src="'.$image.'" alt="'.get_the_title($post_id).'" />';
    						$output .= '<span class="zoom-icon"></span></a></figure>';
    					} elseif ($mediaType != 'Video' && $mediaType != 'Audio') {
    
    						$thumbid = 0;
    						$thumbid = get_post_thumbnail_id($post_id);
    
    						$images = get_children( array(
    							'orderby'        => 'menu_order',
    							'order'          => 'ASC',
    							'post_type'      => 'attachment',
    							'post_parent'    => $post_id,
    							'post_mime_type' => 'image',
    							'post_status'    => null,
    							'numberposts'    => -1
    						) ); 
    
    						if ( $images ) {
    
    							$k = 0;
    							//looping through the images
    							foreach ( $images as $attachment_id => $attachment ) {
    								$prettyType = "prettyPhoto-".$rand ."[gallery".$i."]";
    								//if( $attachment->ID == $thumbid ) continue;
    
    								$image_attributes = wp_get_attachment_image_src( $attachment_id, 'full' ); // returns an array
    								$img = aq_resize( $image_attributes[0], $thumb_width, $thumb_height, true ); //resize & crop img
    								$alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
    								$image_title = $attachment->post_title;
    
    								if ( $k == 0 ) {
    									if (has_post_thumbnail($post_id)) {
    										$output .= '<figure class="featured-thumbnail thumbnail">';
    										$output .= '<a href="'.$image_attributes[0].'" title="'.get_the_title($post_id).'" rel="' .$prettyType.'">';
    										$output .= '<img src="'.$image.'" alt="'.get_the_title($post_id).'" />';
    									} else {
    										$output .= '<figure class="featured-thumbnail thumbnail">';
    										$output .= '<a href="'.$image_attributes[0].'" title="'.get_the_title($post_id).'" rel="' .$prettyType.'">';
    										$output .= '<img  src="'.$img.'" alt="'.get_the_title($post_id).'" />';
    									}
    								} else {
    									$output .= '<figure class="featured-thumbnail thumbnail" style="display:none;">';
    									$output .= '<a href="'.$image_attributes[0].'" title="'.get_the_title($post_id).'" rel="' .$prettyType.'">';
    								}
    								$output .= '<span class="zoom-icon"></span></a></figure>';
    								$k++;
    							}
    						} elseif (has_post_thumbnail($post_id)) {
    							$prettyType = 'prettyPhoto-'.$rand;
    							$output .= '<figure class="featured-thumbnail thumbnail">';
    							$output .= '<a href="'.$url.'" title="'.get_the_title($post_id).'" rel="' .$prettyType.'">';
    							$output .= '<img  src="'.$image.'" alt="'.get_the_title($post_id).'" />';
    							$output .= '<span class="zoom-icon"></span></a></figure>';
    						}
    				
    Plugin Author David Aguilera

    (@davilera)

    Hi!

    As discussed in other support threads and in the FAQ, the plugin only works with themes that use the function (get_)the_post_thumbnail to print the featured image. Your theme uses a different set of functions: get_post_thumbnail_id and wp_get_attachment_url.

    In order to fix the issue, the only thing you can do is identify the locations in which your theme uses those functions and add an if condition before them, so that it uses the external featured image.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Cherry Framework 3.1.5 Incompatible?’ is closed to new replies.