• Ken

    (@synsanken)


    Do I need a plugin to post code in my articles?

    I want to post examples like this:

    SET ECHO ON;

    BEGIN
    EXECUTE IMMEDIATE ‘DROP TABLE USERS’;
    EXCEPTION
    WHEN OTHERS THEN
    IF SQLCODE != -942 THEN
    RAISE;
    END IF;
    END;

    Should I just manually type < pre class=”code-example”> … and then add the class to additional css?

    • This topic was modified 1 year, 4 months ago by Ken.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The answer to this depends on which editor you use to edit the content of your posts. In the block editor, there is the code block: https://gogutenberg.com/blocks/code/ – something similar in other editors.

    Thread Starter Ken

    (@synsanken)

    I used the classic editor plugin because the other editor makes me throw up.

    In the Classic Editor you can store such source codes in the text view, but you must then write them there in coded form in order to output them.

    Example:

    <pre>&lt;strong&gt;test&lt;/strong&gt;</pre>

    This would output an HTML text surrounded by a pre element.

    In the HTML view, you can at least write what is between the pre element, but you can only write the pre element in the text view.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Code’ is closed to new replies.