admin管理员组

文章数量:1191737

I have a Wordpress website and I want it to display raw snippet codes on the front end but it keeps showing the output. This is what I need to show on the front end

I have used several plugins like a module within Elementor Pro ... highlighter, etc,HTML Editor, Syntax Highlighter, Insert HTML Snippet, PHP Code Widget, Raw HTML Snippets, SyntaxHighlighter Evolved, SyntaxHighlighter Evolved: VHDL Brush

How do I get this done?

I have a Wordpress website and I want it to display raw snippet codes on the front end but it keeps showing the output. This is what I need to show on the front end

I have used several plugins like a module within Elementor Pro ... highlighter, etc,HTML Editor, Syntax Highlighter, Insert HTML Snippet, PHP Code Widget, Raw HTML Snippets, SyntaxHighlighter Evolved, SyntaxHighlighter Evolved: VHDL Brush

How do I get this done?

Share Improve this question edited Sep 23, 2022 at 20:47 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Sep 23, 2022 at 17:47 LoudHouse FamilyLoudHouse Family 33 bronze badges 1
  • Please note that plugin recommendations are off-topic for our site – bosco Commented Sep 23, 2022 at 18:36
Add a comment  | 

1 Answer 1

Reset to default 0

If you are using Gutenberg:

  1. In your WordPress dashboard, click Posts or Pages.
  2. Select Add New or hover over an existing post or page and select Edit.
  3. Place your cursor where you want to display the code.
  4. Click the Add Block icon (the plus sign) and search for "code". Select the code block when it appears.

If you are using the Classic Editor

Display code snippets by using the preformatted text option.

  1. Open the post where you want to include the code using the classic editor.
  2. Enter your code in a text box
  3. Highlight the code snippet and choose the preformatted text option from the dropdown.

Edit: Gutenberg Example:

<ul id=”mylist”>
  <li id=”list-item3″>text 3</li>
  <li id=”list-item4″>text 4</li>
  <li id=”list-item2″>text 2</li>
  <li id=”list-item1″>text 1</li>
</ul>

Screenshots showing results here:

本文标签: pluginsHow can I display custom snippet codes in the front end of my WordPress site