Skip Navigation

[Gelöst] Featured Image shortcode not working as rendered html has width & height 1 pixel

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.

This topic contains 7 Antworten, has 2 Stimmen.

Last updated by markW-13 vor 5 Jahre, 3 Monate.

Assigned support staff: Shane.

Author
Artikel
#444722
prod-cont-template.JPG

I am trying to: insert a standard post featured image into a content template

I visited this URL: hidden link but this won't work unless you change your hosts file to 134.213.206.16 for this sub-domain name

I expected to see:

<img src="<em><u>hidden link</u></em>" class="wp-post-image" alt="100134.png" />

Instead, I got:

<img width="1" height="1" src="<em><u>hidden link</u></em>" class="attachment-thumbnail size-thumbnail wp-post-image" alt="100134.png" />
#444866

Shane
Supporter

Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mark,

Thank you for contacting our support forum.

I'm not able to see the link that you sent to me. Is it on a private server?

Also could you try doing this and let me know what the output is.

[wpv-post-featured-image output='url']

Thanks,
Shane

#444898

Thank you for your response. The link won't work unless you change your hosts file to 134.213.206.16 for this sub-domain name. Details for both Mac and PC at:
hidden link

(if you're able to do that) I'd be pleased to send you a log-in account for the WordPress back office by email.

I'm unable to test whether including output='url' will solve the issue at the moment (because my development zone's hosting server is not fully working this afternoon) but as soon as I can respond about that, I will.

#444971

Shane
Supporter

Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mark,

Thanks for keeping me updated.

I'll add this to my host files and have a look.

Also please let me know the result as soon as possible.

Thanks,
Shane

#445104
prod-img.JPG

Hello Shane,

The image url code line is rendered and visible now. Screenshot attached.

Let me know your email address if you'd like some login credentials please.

#445325
changelog.JPG

Hello Shane,

I've made some progress by trial and error. The changes I made were recorded in a text file, a screenshot of which is attached.

I'd really appreciate your comments when you have time because I want to code this correctly rather than 'fudge it' myself using trial and error until something happens to work on my computer and on my screen.

#445373

Shane
Supporter

Languages: Englisch (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Mark,

So the real problem is if we let the shortcode render the entire url itself.

The best solution would be to manually wrap the shortcode in a img tag to render the image like this.

<img src="[wpv-post-featured-image output='url']" />

Ofcourse you can still add other attributes to the shortcode but it should render the image correctly now.

Please let me know if this helps.
Thanks,
Shane

#445795

Hello Shane,
Thank you. I think I've arrived at the same (or a very similar) solution now. Please mark this request as resolved.