Skip Navigation

[Resolved] Showing source code inside a view

This thread is resolved. Here is a description of the problem and solution.

Problem:

I am trying to show shortcode inside a view. I'm using the SyntaxHighlighter plugin to show some HTML for embedding a linked image from my site.

[html]



[/html]

Solution:

You can warp the HTML codes into

tag, for example:
https://pastebin.com/uTVAFh5s

See screenshot:
https://cdn.toolset.com/wp-content/uploads/2018/03/626795-code3.JPG

Relevant Documentation:

https://codex.wordpress.org/Writing_Code_in_Your_Posts

100% of people find this useful.

This support ticket is created 6 years 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#626034

Hi!

I am trying to show shortcode inside a view. I'm using the SyntaxHighlighter plugin to show some HTML for embedding a linked image from my site. It can be seen on hidden link

[html]
<a href="[wpv-post-url]">
&lt;img src=&quot;<em><u>hidden link</u></em>;
&lt;/a&gt;
[/html]

But the source code is showing the HTML entities, and not the normal HTML. Also when i use the code tags Views is showing the code this way. When I try to use it in a normal post it works and shows the normal html.

Is there a way to show some source code in Views?

Thanks ?

#626708

Thanks. I tried this, but it doesn't work. I guess the Views plugin does something with the HTML.

Is there maybe another way to show some code in HTML on my page?

#626795
code3.JPG

I have tried the codes (https://pastebin.com/uTVAFh5s) in my localhost

it works fine, see screenshot code3.JPG, I am not sure if there is any other problem in your website, if you still need assistance for it, please provide a test site with the same problem, and fill below private message box with login details, I need a live website to test and debug, thanks

#626879

Thanks, i was still using the SyntaxHighlighter plugin, and that plugin doesn't work well with Views. Just using the <pre> tags works fine. 🙂

#627157

You are welcome

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.