Adding Thumbnail images to shortcode
-
Hallo Ricard,
thank you for the great plugin. It is real fun.I display with “do_shortcode” your plugin-shortcode in a PHP Widget. I added the WP Thumbnail to the displayed list. See below.
... // Build the post list if($thumbs_ratings_top_query->have_posts()) : $return .= '<ol class="thumbs-rating-top-list">'; while($thumbs_ratings_top_query->have_posts()){ $thumbs_ratings_top_query->the_post(); $return .= '<li>'; $return .= '<span>' . the_post_thumbnail( 'thumbnail' ) . '</span>'; $return .= '<a href="' . get_permalink() . '">' . get_the_title() . '</a>'; if( $show_votes == "yes" ){ ...
It gets displayed, but not as part of the list. See here:
<div class="execphpwidget"> <img class="attachment-thumbnail wp-post-image" width="150" height="150" alt="" src="https://... /cloud-150x150.jpg"></img> <img class="attachment-thumbnail wp-post-image" width="150" height="150" alt="" src="https://... /sun-150x150.jpg"></img> <ol class="thumbs-rating-top-list"> <li> <a href="https://.../">Title</a> </li> <li><a href="https://.../">Title</a></li> </ol> </div>
Do you have an idea how i can get the thumbnail displayed in the list.
Regards
Jan-Philipp
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Adding Thumbnail images to shortcode’ is closed to new replies.