Here’s a simple guide on how to use the Code Block:
- Access the Editor: When you’re editing a post or page, you’re in the WordPress editor.
- Add a New Block: Click on the “+” icon to add a new block. This opens a menu of different block types.
- Choose Code Block: In the block menu, search for “Code” and click on the Code Block option. This inserts a new Code Block into your post or page.
- Insert Your Code: Now you can paste or type the code snippet you want to display into this block.
- Preview and Publish: Always preview your post or page to see how the Code Block looks on your site. Once satisfied, you can publish or update your content.
Remember, the Code Block is for displaying code as text, not for running it. If you need to execute the code, you’ll need to insert it into the appropriate place in the theme files or use a plugin designed for that purpose.