For the life of me I can't get a clean answer to my issue. The codex says to use get thumbnail but whenever I exchange the current code for the get thumbnail everything just stops working. I'm fairly new to php and this is my first big project suggestions?
Here's the whole code I'm working with
<?php
$wpfp_before = "";
echo "<div class='wpfp-span'>";
if (!empty($user)) {
if (wpfp_is_user_favlist_public($user)) {
$wpfp_before = "$user's Favorite Posts.";
} else {
$wpfp_before = "$user's list is not public.";
}
}
if ($wpfp_before):
echo '<div class="wpfp-page-before">'.$wpfp_before.'</div>';
endif;
if ($favorite_post_ids) {
$favorite_post_ids = array_reverse($favorite_post_ids);
$post_per_page = wpfp_get_option("post_per_page");
$page = intval(get_query_var('paged'));
$qry = array('post__in' => $favorite_post_ids, 'posts_per_page'=> $post_per_page, 'orderby' => 'post__in', 'paged' => $page);
// custom post type support can easily be added with a line of code like below.
// $qry['post_type'] = array('post','page');
query_posts($qry);
echo "<div>";
while ( have_posts() ) : the_post();
echo "<div><a href='".get_permalink()."' title='". get_the_title() ."'>" . get_the_title() . "</a> " ;
wpfp_remove_favorite_link(get_the_ID()) . the_post_thumbnail('medium' );
echo "</div>";
endwhile;
echo "</div>";
echo '<div class="navigation">';
if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
<div class="alignleft"><?php next_posts_link( __( '← Previous Entries', 'buddypress' ) ) ?></div>
<div class="alignright"><?php previous_posts_link( __( 'Next Entries →', 'buddypress' ) ) ?></div>
<?php }
echo '</div>';
wp_reset_query();
} else {
$wpfp_options = wpfp_get_options();
echo "<ul><li>";
echo $wpfp_options['favorites_empty'];
echo "</li></ul>";
}
echo '<p>'.wpfp_clear_list_link().'</p>';
echo "</div>";
wpfp_cookie_warning();
During the_post_thumbnail('medium') it works once I change it to the get_the_post_thumbnail everything falls apart. I've tried adding the src and I have also added the following code wordpress told me to add to the functions section.
add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
function my_post_image_html( $html, $post_id, $post_image_id ) {
$html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>';
return $html;
}