Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 120248

felixlvh on "[Plugin: Multiple Post Thumbnails] Widget"

$
0
0

I'm keen to make this works for widget. My current widget code as below how can i display the second and third featured posts image?

if ($r->have_posts() ) {
		$output = '<div class="recent-posts-wrap">';
		$output .= '<ul class="posts-list">';
		while ( $r->have_posts() ) {
			$r->the_post();
			$output .= '<li class="clearfix">';
			if ( $thumbnail != 'false' ) {
				$output .= '<a class="thumbnail" href="' . get_permalink() . '" title="' . get_the_title() . '">';
				if ( has_post_thumbnail() ) {
					$output .= get_the_post_thumbnail( get_the_ID(), array( 105, 105 ),array( 'title' => get_the_title(), 'alt' => get_the_title() ) );
				} else {
					$output .= '<img src="' . THEME_IMAGES . '/post-thumbnail.png" width="105" height="105" title="' . get_the_title() . '" alt="' . get_the_title() . '"/>';
				}
				$output .= '</a>';
			}
			$output .= '<div class="post-extra-info">';
			$title = get_the_title();
			$output .= '<a class="post-title" href="' . get_permalink() . '" title="' . get_the_title() . '" rel="bookmark">' . $title . '</a>';
			if ( in_array( 'time', $extra ) ) {
				$output .= '<time datetime="' . get_the_time( 'Y-m-d' ) . '">' . get_the_date() . '</time>';
			}
			if ( in_array( 'desc', $extra ) ) {
				global $post;
				$excerpt = $post->post_excerpt;
				$excerpt = apply_filters( 'get_the_excerpt', $excerpt );
				$output .= '<p>' . wp_html_excerpt( $excerpt, $desc_length ) . '...</p>';
			}
			$output .= '</div>';
			$output .= '</li>';
		}
		$output .= '</ul>';
		$output .= '</div>';
	}

Viewing all articles
Browse latest Browse all 120248

Trending Articles