# Pinned Post Module Featured Image Not Working

**URL:** <https://community.hubspot.com/t/pinned-post-module-featured-image-not-working/4008>\
**Category:** CMS Development\
**Created:** [November 28, 2017, 1:39am UTC](https://community.hubspot.com/t/pinned-post-module-featured-image-not-working/4008 "2017-11-28T01:39:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brentswashburn](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brentswashburn/32/50484_2.png) [@brentswashburn](https://community.hubspot.com/u/brentswashburn)\
**Post date:** [November 28, 2017, 1:39am UTC](https://community.hubspot.com/t/pinned-post-module-featured-image-not-working/4008/1 "2017-11-28T01:39:46Z")

</div>

Hey Hubspotters,

I’m designing a post listening module for use on a pillar page, similar to the way HubSpot’s pillar pages are built, but I’m not able to get the featured image to feed in. Also, any idea how to make it pull from a blog tag instead of having the entry be manual?

Here’s my snippet: (I’ve used this before with no issues)

```auto
<div class="script">
<script type="text/javascript">
$(document).ready(function(){
 $.ajax({
 url: '{{ widget.enter_url_for_first_pinned_post }}',
 dataType: 'html',
 success: function(post) {
 $('.pinnedOneTitle').html($(post).find('#hs_cos_wrapper_name').html());
 $('.pinnedOneDate').html($(post).find('.publishedDate').html());
 $('.pinnedOneFeatImage').html($(post).find('.post-featured-image').html()); 
 },
 complete: function(){
 console.log("Pinned Post One Loaded.");
 }
 });
 $.ajax({
 url: '{{ widget.enter_url_for_second_pinned_post }}',
 dataType: 'html',
 success: function(post) {
 $('.pinnedTwoTitle').html($(post).find('#hs_cos_wrapper_name').html());
 $('.pinnedTwoDate').html($(post).find('.publishedDate').html());
 $('.pinnedTwoFeatImage').html($(post).find('.post-featured-image').html()); 
 },
 complete: function(){
 console.log("Pinned Post Two Loaded.");
 }
 });
 $.ajax({
 url: '{{ widget.enter_url_for_third_pinned_post }}',
 dataType: 'html',
 success: function(post) {
 $('.pinnedThreeTitle').html($(post).find('#hs_cos_wrapper_name').html());
 $('.pinnedThreeDate').html($(post).find('.publishedDate').html());
 $('.pinnedThreeFeatImage').html($(post).find('.post-featured-image').html()); 
 },
 complete: function(){
 console.log("Pinned Post Three Loaded.");
 }
 });
});
</script>
</div>
<div class="featured-posts">
<h3 style="letter-spacing: 1px;text-align:center;">You Might Be Interested In . . .</h3>
<hr>
<div class="media-pinned">
 <div style="width: 90%; margin: 0 auto;">
 <div class="bd">
 <div class="img pinnedOneFeatImage"></div>
 <span class="date pinnedOneDate"> </span>
 <div class="post-header"><h3><a class="pinnedOneTitle" href="{{ widget.enter_url_for_first_pinned_post }}"> </a></h3></div>
 </div>
 <div class="bd">
 <div class="img pinnedTwoFeatImage"> </div>
 <span class="date pinnedTwoDate"> </span>
 <div class="post-header"><h3><a class="pinnedTwoTitle" href="{{ widget.enter_url_for_second_pinned_post }}"> </a></h3></div>
 </div>
 <div class="bd">
 <div class="img pinnedThreeFeatImage"> </div>
 <span class="date pinnedThreeDate"> </span>
 <div class="post-header"><h3><a class="pinnedThreeTitle" href="{{ widget.enter_url_for_third_pinned_post }}"> </a></h3></div>
 </div>
 </div>
</div>

```

---

<div class="post-metadata">

**Author:** ![TRooInbound](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/trooinbound/32/89545_2.png) [@TRooInbound](https://community.hubspot.com/u/TRooInbound)\
**Post date:** [November 28, 2017, 1:27pm UTC](https://community.hubspot.com/t/pinned-post-module-featured-image-not-working/4008/2 "2017-11-28T13:27:48Z")

</div>

Hi @brentswashburn,

Can you please provide post page url which help us to dig out actual issue, as currently by seeing your code we can’t figure out actual issue. And we want to know what type of tag used for **post-featured-image** class.

Team TRooInbound!

---

<div class="post-metadata">

**Author:** ![ndwilliams3](https://avatars.discourse-cdn.com/v4/letter/n/c4cdca/32.png) [@ndwilliams3](https://community.hubspot.com/u/ndwilliams3)\
**Post date:** [November 28, 2017, 4:54pm UTC](https://community.hubspot.com/t/pinned-post-module-featured-image-not-working/4008/3 "2017-11-28T16:54:40Z")

</div>

without seeing the page, I’m assuming that you are using a text module for the image url based on seeing this:

`{{ widget.enter_url_for_first_pinned_post }}`

if **export\_to\_template\_context** is TRUE you need to use:

`{{ widget_data.enter_url_for_first_pinned_post.value }}`

---

<div class="post-metadata">

**Author:** ![brentswashburn](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/brentswashburn/32/50484_2.png) [@brentswashburn](https://community.hubspot.com/u/brentswashburn)\
**Post date:** [November 28, 2017, 5:01pm UTC](https://community.hubspot.com/t/pinned-post-module-featured-image-not-working/4008/4 "2017-11-28T17:01:30Z")

</div>

Pretty easy fix actually, I forgot that my JS was pulling the image from the class on the Div, so on this client’s blog I wasn’t use .post-featured-image as a class. I actually ended up adding a snippet using the Hubl {{ content.post\_list\_summary\_featured\_image }} to automatically pull in the pictures like I wanted. This is better because it’s not reliant on what class I’m using. For anyone wanting to use that snippet, I simply added:

`<div class="post-featured-image"><img src="{{ content.post_list_summary_featured_image }}"></div>`

To my post template. The same will need to be done for the date field, but I’ve decided not to use the date in this instance.
