• twan

    (@twan)


    I’ve did a search on it, because I would have thought that there were people with the same problem but I guess not;

    The <code> tags are giving me problems

    Lets take an example

    #include <stdio.h>

    WordPress auto tags it, and gives me the tag <stdio> and </stdio> in my post. Not what I want ofcourse.. it should not auto complete tags in the <code> environment.. Anyway to fix this ?

    edit: It’s working here though..

Viewing 7 replies - 1 through 7 (of 7 total)
  • Lorelle

    (@lorelle)

    I’m not sure what these tags are. I’ve never seen them before. Are they from some special program or plugin? Is this like something you are hacking or manually adding to get it to work, like a graphic gallery or something like that? I guess we need a little more information.

    Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    It’s the programming language C. What twan wants to do is put the code on his page, post it, but WordPress is automatically closing the tags.

    Lorelle

    (@lorelle)

    Ah, I assume because you can’t use C in a post, just as you can’t use html or php without running a special plugin.

    Is there a plugin for twan’s issue – to recognize C?

    tahongawaka

    (@tahongawaka)

    Instead of using #include <stdio>, try using the htmlentities for the < as &lt; and > as &gt;

    Perhaps someone might be able to produce a hack of the WordPress code to not close tags within the code tags.

    Lorelle

    (@lorelle)

    Okay, so I just want to understand this. Is Twan using C language in a post to describe code, as in an explanation, or using C language in a post in order to make something happen, like initiate a plugin or event?

    Tahongawaka’s answer works for including code as part of your text, but I don’t think it will work if the code is initiating programming….I is confused.

    And if you are writing code as an example in the post, You can use the following tags:

    * pre
    * code
    * tt

    and use the &lt; etc to force the codes to appear contextually.

    Thread Starter twan

    (@twan)

    To answer your question; no, i’m not trying to get a C program to do something in WordPress.. I don’t even think that could be ever possible ??

    I just want to display C language code inside WordPress. Ofcourse, within the “" tags.. But as others replied, this is something WordPress just does.. so I will have to live with it.

    I will try some of the solutions here and get back to you

    Thread Starter twan

    (@twan)

    As said, using the &…; stuff, works perfect.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘C-code gives some problems with tags’ is closed to new replies.