get_the_post_thumbnail() issue
-
Hi,
I am having issue with get_the_post_thumbnail() function. Basically it returns the thumbnail but with some of the code (from firebug I can feel it’s an issue with quotes but it looks like some parameters are added from the function as they are not in my code).
You can see it here: https://test.assatena.it/#service
scroll around and you will see that every image (except the ones in the first section after the jumbotron because they are hardcoded without using the function and the media logo at the bottom)
code sample that I am using
<section id="service" class="bg-green"> <?php $ser = array( 'numberposts' => '1', 'category_name' => 'service'); $recent_service = wp_get_recent_posts( $ser ); foreach( $recent_service as $my_service ): $service_title = $my_service["post_title"]; $service_id = $my_service["ID"]; $service_img_src = get_the_post_thumbnail($service_id, 'full'); $service_content = get_post_field('post_content', $service_id); ?> <div class="container"> <div class="row"> <div class="my_post_content"> <div class="col-lg-6 text-left"> <h3 class="service-heading"><?php echo $service_title; ?></h3> <p><?php echo $service_content; ?></p> </div> <div class="col-lg-1"> </div> <div class="col-lg-5 text-left"> <img id="service_img" class="img-responsive img-centered img-rounded" src="<?php echo $service_img_src ?>" /> </div> </div> <?php endforeach; ?> </div> </div> </section>
thanks!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘get_the_post_thumbnail() issue’ is closed to new replies.