WordPress HELP!!

Public Group active 1 year, 2 months ago

Embedding code into posts

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #38591

    I’ve activated the WP-Code-Highlight plugin on my site and want to be able to include code into my entry. However, WP seems to be stripping out certain parts of it. (I’m in the text editor, not the visual editor.) In particular, it seems to dislike the input element as well as the script element.

    This works on other, non-Commons WP blogs without a problem:


    However, the code is being stripped from the entry on my Commons site:


    Any help would be appreciated!


    Maybe minify the code before pasting?
    Also,certain that you pasted into text view?


    Hi –
    I tried with that plugin and got the same results – it does seem to strip out certain tags. Can you try the “Syntax Highlighter Evolved” plugin. That worked for me using your same code snippet. I wrapped snippet in [splus]…[/splus] tags. Make sure that you stay in text editor. Hope this helps.


    Thanks for the replies!

    Stephen, yes, I’m definitely in the text editor. (I’ve turned off the visual editor altogether.) And it’s a how-to post so I want the code to be clear. Minifying it would muddle it for people unfamiliar with HTML/JavaScript.

    Scott, I tried the SyntaxHighlighter Evolved plugin but it seems to encode all the brackets. See the attached.

    Even without a plugin, wrapping code in <pre> tags should make it display as-is but that’s also failing.

    You must be logged in to view attached files.

    Hi Allie – that is odd. On my site, your code snippet renders fine using the SyntaxHighlighter Evolved plugin. Could you try testing on a brand new page. Perhaps you have some encoding tags that are throwing off the display?


    I wrote a new entry (kept it in draft mode, though) and pasted the code… with the same results. Tried reactivating the WP-Code-Highlight plugin and checked the post. No change :-/


    Hi Allie – I created a new site, using your theme to see if I could replicate your issue. I also invited you as an admin to the site. I created the page here to test the sytax highlighter evolved, using your code snippet: http://chunktest.commons.gc.cuny.edu/6-2/

    It seems to work fine. Can you check out the code tags and see if they match yours?


    Since I was writing a post, I made two posts to see how the two plugins work:



    WP-Code-Highlighter fails while SyntaxHighLighter Evolved does display the code. Hmm…

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.