Skip Navigation

[Resolved] Retrieve a random featured image

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by thibaultS 6 years, 9 months ago.

Assisted by: Minesh.

Author
Posts
#668426

Tell us what you are trying to do?
I want to get the URL of a featured image of one of my custom post (Step or POI). Only the URL and only from posts with featured image

Is there any documentation that you are following?
https://toolset.com/forums/topic/retrieve-only-posts-with-a-featured-image/

and

https://toolset.com/forums/topic/cruft-output-by-views/

But it returns empty String with line breaks.

What is the link to your site?
hidden link

#670672

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please tell me where exactly you want to display feature image url and post url - on content template?

#671673

Hello,

On my layout i have a simple css style block (#masthead) that specify the background of the header section. I need to retrieve randomly a featured-image url of specific custom-posts types (steps and POIs).

With the actual code i can retrieve the url (without the standard html of a view) but sometimes it retrieved the url feature-image of post with no featured-image, so the url is empty and the header blank.

I check today and i can't reproduce the problem. Certainly a cache problem. Sorry

Regards