Show CODE in blog

  • Author
    Posts
  • #1123582

    gsamaras
    Member

    The code tag is actually useless, in my opinion.

    No indentation provided and no colors.

    Is there something I can do to show some c and cpp code nicely in my blog?

    //this would be far too easy with a css rule :P

    The blog I need help with is gsamaras.wordpress.com.

    #1123727

    timethief
    Member

    No indentation provided and no colors.

    Code for initial line indentation
    Simplest way is to use this at the beginning of each paragraph:
    <span style=”margin-left:32px;”>FIRST WORD HERE</span>

    and use line breaks instead of paragraph breaks to separate the paragraphs (i.e. one instead of two returns in the HTML editor, shift-return in the Visual editor). https://en.forums.wordpress.com/topic/code-for-initial-line-indentation?replies=4#post-840453

    #1123728

    timethief
    Member

    WordPress.com does not choose to include all of the TinyMCE editor modules. See here for what’s available:
    http://en.support.wordpress.com/editors/
    http://en.support.wordpress.com/visual-editor/

    There are three ways to change fonts on WordPress.com free hosted blogs.

    (1) Changing font families, colors and size in text in posts or pages either post by post or page by page by coding into the HTML editor. http://en.support.wordpress.com/editors/font-size-color/

    (2) Changing font colors in text in posts or pages either post by post or page by page using the #4 icon (Select text color – change the text color) in Row 2 the Visual editor. http://en.support.wordpress.com/visual-editor/#row-2

    (3) Changing all font families, colors and sizes throughout the whole blog by purchasing an annually renewable Custom Design upgrade and using Typekit Fonts with Staff support. http://en.support.wordpress.com/custom-design/

    Note: A few themes do provide for changing font color in the Blog Title and/or optional Tagline and/or links. In the majority of themes font changes to font families, colors and size in the blog title, tagline, menu, post titles, page titles, categories and tags, widget headings, comments and links cannot be done without purchasing an annually renewable custom design upgrade and doing the required CSS editing. http://wpbtips.wordpress.com/2009/03/24/color-customisable-themes/

    #1123731

    justpi
    Member

    To display code you need the sourcecode shortcode. See here:
    http://en.support.wordpress.com/code/posting-source-code/

    #1123734

    gsamaras
    Member

    justpi that is what I needed :)

    timethief I really appreciate your responses :D

    Thanks!

    #1123761

    justpi
    Member

    You’re welcome.
    By the way, if you don’t want the right sidebar video to be cut off, you can modify the youtube shortcode. Change this:
    [youtube=http://www.youtube.com/watch?v=MDgOFoqM-tQ]
    to this:
    [youtube=http://www.youtube.com/watch?v=MDgOFoqM-tQ&w=224]
    And you don’t need the Music Player widget for that: you could have used a Text widget.

    #1123768

    gsamaras
    Member

    Thanks for making proposals! :D

    Well I used this

    [youtube=http://www.youtube.com/watch?v=MDgOFoqM-tQ&w=224]

    in the text widget. Again it starts from 59.12 sec.
    As you can see the & is replaced by the corresponding html entity.
    Same thing with music player widget.

    #1123774

    justpi
    Member

    a) When I said cut off, I meant visually!
    b) “Again it starts from 59.12 sec.” I’m not experiencing this.
    c) “the & is replaced by the corresponding html entity.” Always. Not to worry.

    #1123791

    gsamaras
    Member

    I am going to remove it then. Thanks for pointing that out.

The topic ‘Show CODE in blog’ is closed to new replies.