Skip Navigation

[Closed] Visual editor cell's HTML code is displayed as text on front page

This support ticket is created 7 years, 3 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
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqas 7 years, 3 months ago.

Assigned support staff: Waqas.

Author
Posts
#330811

I am trying to: display an image through the Visual Editor cell.

When I enter the code below, the front-end just writes out the code instead of displaying the image.

<img class="site-logo" src="<em><u>hidden link</u></em>" alt="Site logo" style="width:100px; height:100px;">

The image appears inside Layouts' editor, but it doesn't appear on the page.

Anyhow... I would like to pass a certain custom post's image URL into this <img> but I don't know how to refer to ONE of those posts. This code below would refer to the correct data-field, but it wouldn't point to any particular post's data.

[types field="site-logo" width="100" height="100" url="true" resize="proportional"][/types]

How can I add the specific post's ID to this? I don't even know how to find a post's ID...

#330945

Waqas
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

The short code [types] supports an 'id' parameter, which can be used to pass the ID of a certain post. Like below:

[types field="site-logo" width="100" height="100" url="true" resize="proportional" id="123"][/types]

Where 123 is the post id. You can find ID of the post just by going to post's edit page and observe the address bar of the browser. A URL something like this hidden link contains the Post ID in 'post' parameter. As per this sample URL, the post ID is 48.

You can use above short code in the <img> tag (as below), to produce a URL of the Image:

<img class="site-logo" src="[types field='site-logo' width='100' height='100' url='true' resize='proportional' id='123'][/types]" alt="Site logo" style="width:100px; height:100px;">

Please read more about this short code and field options at https://toolset.com/documentation/customizing-sites-using-php/functions/#image

For the other issue, "The image appears inside Layouts' editor, but it doesn't appear on the page.", if above solutions do not help, can you please provide some debug information about your site? Please see https://toolset.com/faq/provide-debug-information-faster-support/ for more information.

I have enabled debug information area for your next reply.

The topic ‘[Closed] Visual editor cell's HTML code is displayed as text on front page’ is closed to new replies.