There are a few ways to post code and have it formatted as code.
Format a code block:
1 - Prepare the code and copy it to the clipboard.
2 - Put the mouse/marker on an empty line and press the code button </>
.
3 - A text “type or paste code here” appears after the empty line.
4 - Paste the clipboard to replace the pre-selected text with the code block.
5 - (Check that the “type or paste code here” is gone or delete it if it is not.)
1 - Paste or type the code block starting at an empty line.
2 - Select the pasted code block.
3 - Press the code button </>
to format the selected code block.
Format inline code typed/inserted in a text line:
1 - Type the code part in a regular line of text.
2 - Select the code part.
3 - Press the code button </>
to format that part.
Now I happen to remember where the posting guide is.