Support » Fixing WordPress » A code to show my "scripts"

  • Hey everyone, im looking for a code to put on to my site so that I
    can highlight my scripts. All ive got at the moment is quote! and
    its not looking good! im wanting something to highlight it as so you
    can copy and paste from the important parts instead of what else is
    written in the post.

    This is and example from my site:
    I want it to look more like this:

    Or anything nearer to that. Can someone help me please?


    Edit: I am trying to find something like this:
    which im not sure how to call it? code highlighter? anyway its what
    im trying to get on my site! something like it anyways.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Kathryn


    Automattic Happiness Engineer

    I think you’re talking about the <code>code here</code> or <pre>insert here</pre> code. “Code” is more for short small codes like I did above, and pre is for more like several lines of code.

    Are you familiar with CSS? You can use whatever style you want, but I’ll do a similar style to the second example.

    For the second example you showed it might look like this, and you can use images for the rounded corners, but you can also use border-radius but it doesn’t show up in IE. Customize it to give your site a nice touch and be unique and original, that’s what I’d say is the best, and to compliment your theme.

    [CSS moderated as per the Forum Rules.]

    Em, thanks guys.. and yeah its what im after, Belle224 where do I add that? in the style.css? ive tried it just now but nothing! I did a background color of yellow but it didnt change! I should use the html color codes right? Thanks
    Also, if you see here:
    Weather or not im doing it wrong, how would I activate it on my code? with a “code” and < – > etc or something like that? cant I make a custom tab in which I press with it in the tab itself so I can just put the script, then press the tab and bang! the code is in there? lol

    Sorry and thanks.

    Sorry I don’t understand what you mean by “tab”?

    Yes, you add it to your CSS. I’d actually recommend for long lines of code to use “pre”. Here I’ve actually redid it and styled it. Enjoy! When you hover over it the rest of the code shows, I’ve tested it and it works. Instead of using <code>code here</code> for your long blocks of code, use <pre>code here</pre>.

    Here’s the styling, customize it to your liking.

    [CSS moderated as per the Forum Rules.]

    Oh wow! thats cool…
    thank you so much!!!! Rep* if they had it on here, lol… tab was I meant button in my editor! so when im writing a post etc I can just press the button with the “pre” and “/pre” inside it! get what I mean? thanks again.

    Em,.. ok, spoke to soon! now it seems not working anymore!

    This thread: looks fine right?
    though ive took out the “pre” and “/pre” tags and its still showing! now when I put the pre tags in others threads, nothing is working! sometimes it just shows up half the code, or it mixes all the thread together like in one big post without any lines etc…

    I do just make a script put the

     code here and then 


    Apart from that, its looking cool… when it works! lol

    Oh, and just incase… here is the code ive got now incase its cause that:

    [CSS moderated as per the Forum Rules.]

    Hm.. I’m confused of what you mean, can you show me a link of when it messes up? And the thread you said that had no pre code I checked the source and it did…? I also checked the other links on your site and it worked. Btw, simplified code, I simplified the border-radius.

    [CSS moderated as per the Forum Rules.]

    Ok, added the updated code! put in the “pre” tags,.. and now look: the tags are showing in the post!
    but why? 🙁

    Here is another post which ISNT working!
    with tags still showing in the post though.

    So,.. what could I be doing wrong?

    Hm, that’s really odd. I don’t think you’re doing anything wrong… maybe try changing pre to code? like instead of pre { do code {. And if all else fails and there’s no solution, make it a class or id in the CSS and then you’d insert a div when you want to add codes.

    Ok, its fixed! now I should say sorry to you because it was all my fault! :S lol. I was put the tags in the normal post, NOT in the html code part when you write a post! I was doing it in the “visual” part…

    So.. anyways, its fixed now, thank you so much for your help and time. 🙂

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘A code to show my "scripts"’ is closed to new replies.