Image not showing on posts element

Hello,

I have a posts element set up on this page, under the heading “Research you’ve made possible”: https://parkinsonca.thedev.ca/research/. The featured image is inside of a figure element (see screenshot below), but the figure isn’t rendered at all when I view source on the page. However, I know the image is working because it shows up when I take the image out of the figure element. I have this set up exactly the same way on another page (https://parkinsonca.thedev.ca/getinvolved/participate-in-research-studies/) and the images are showing.

What am I missing?

image

Hi Marina,

Thanks for reaching out!

Would you mind sharing your admin credential so that we can check your page settings? To do that, please give us the following information in a Secure Note.

  • WordPress Login URL
  • Admin level username and password
  • Name of the Layout Builder or page URL

You can find the Secure Note button at the bottom of your posts.

Thank you.

Hi Marc, I’ve included admin credentials for you. Let me know what you find. Thanks!

Hi Marina

I have checked the posts from the first page URL and found that the Featured Image is not set to those posts.

  1. https://parkinsonca.thedev.ca/news-media-story/parkinson-canada-in-november-hospital-news/
  2. https://parkinsonca.thedev.ca/news-media-story/man-with-parkinsons-disease-refuses-to-give-up-on-dream-of-sailing/
  3. https://parkinsonca.thedev.ca/news-media-story/riding-for-a-cure/

Whereas the posts on the 2nd page are having the Featured Image set into it.

  1. https://parkinsonca.thedev.ca/clinical-trial/cannabis-oil-for-pain-in-parkinsons-disease/
  2. https://parkinsonca.thedev.ca/clinical-trial/help-find-out-how-mood-and-feelings-of-control-affect-taking-medication-for-parkinsons/
  3. https://parkinsonca.thedev.ca/clinical-trial/complete-a-questionnaire-on-the-current-state-of-parkinsonian-tremor-treatment/

To get the images on the first page, I would suggest you set the Featured Image to those specific posts first.

Hope it helps.
Thanks

Hi Tristup,

That is very much intentional as the images used in the first URL are set to a meta field other than the featured image. If I take the featured image outside of the figure, it shows up, so I know it’s reading the meta field properly. I tried with a regular image element as well instead of the featured image and it still wasn’t working.

Hi Marina,

I have checked your posts for these two pages but didn’t find any meta value that is storing the image or image URL. And it can be assumed that the Figure and the Image element all are set to {{dc:post:featured_image_id}} which shows the featured image. If your meta field store the image URL, you need to use it as the src attribute of the image tag like the example given below.

<img src="{{dc:post:meta key="my_image_url"}}">

If that is not the case and you are not able to fetch the meta field value in any way, please let us know the specific meta field so we can set the value at your end and check.
Thanks

Hi Tristup,

I tried the following:

  1. Created a Text element, used your code, and replaced “my_image_url” with the meta field.
  2. Put the Text element inside the Figure element. The image refused to display.
  3. Tried taking the Text element outside of the Figure element. The image displayed, but does not have the animations afforded to me by the Figure element.

Not sure what setting in Figure is stopping the display of any image that isn’t the featured image, and whether it can be configured.

I’ll send another secure note with the name of the meta field.

Hi Marina,

The reason why the image in your figure is not showing because you set a condition in the figure element that the element should only be visible when the featured image is set. I suggest that you remove that condition and it will show your image.

Hope that helps.

Thank you.

Thanks Marc. That solved it. Probably a default setting of the Posts element that I never noticed.

We are delighted to assist you with this.

Cheers!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.