Support » Requests and Feedback » Feature request. add class on aligned text

  • When aligning text in the editor wordpress only adds some css to the text formatting tag:
    <p style="text-align:right;">example text aligned right</p>
    What I would love is, if wordpress instead/aswell gave it a class simmilar to the way images are handled:
    <img class="alignright" src="/example.jpg" />
    Having wordpress doing it with the text formatting tags as well would open up to a new level in designing pages in wordpress…
    Imagine how many nice designs you have seen with a 3 column layout, imagine if you easily could do that in wordpress…
    I believe having worpress putting a class on any kind of aligned text would help theme designers alot.
    <p class="alignright">example text aligned right or with any other styling chosen by the theme designer</p>

Viewing 8 replies - 1 through 8 (of 8 total)
  • Is this really that unintresting that it dosen’t even get a single reply???

    Really that should be done with div tags… I have this vague memory of wanting to pull classes out of the paragraph tag.

    <div class="alignright">Blah blah blah...</div>

    only, if you use divs, the text wont align the same way if you just use
    alignright {

    You know how in your css you define img.alignright { }?

    Same idea here 🙂 Its either alignright p {} or p.alignright {}

    What i was thinking about was that divs have different properties then paragraphs and by putting in loads of divs you would mess up the basic functionality..
    It is easy to just add a div with a class o every piece of text you want in a separate place…

    but i want the tinymce to do it so my clients don’t have to dive into code…

    Just realized it would be smarter to just have theme support for adding buttons to the tinymce…
    Adding a button to the tinymce could be done by putting something like this in the functions.php of you theme :

    if ( function_exists('register_tinymcebutton') )
    		'name' => 'Float Right',
    		'before_marked' => '<div class="floatright">',
    		'after_marked' => '</div>',
    		'buttone_image' => '',

    before_marked and after_marked is basically before and after what ever the user has marked in the tinymce…

    but i want the tinymce to do it so my clients don’t have to dive into code…

    Oh. That’s different in itself 🙂 I don’t generally think much about TinyMCE (past the headaches it gives me).

    Have you seen this:

    seems like that plugin only allows for moving around the buttons… not creating new ones…

    Hrm. There’s a plugin out there to add new buttons. I can’t remember what it is (and as I mentioned, I don’t actually use tinymce, so my memory is limited to … y’know, what I’ve used sometimes).

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Feature request. add class on aligned text’ is closed to new replies.