Feature request. add class on aligned text (9 posts)

  1. Alexander Zeiher
    Posted 5 years ago #

    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>

  2. Alexander Zeiher
    Posted 5 years ago #

    Is this really that unintresting that it dosen't even get a single reply???

  3. 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>
  4. Alexander Zeiher
    Posted 5 years ago #

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

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

    Same idea here :) Its either alignright p {} or p.alignright {}

  6. Alexander Zeiher
    Posted 5 years ago #

    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' => 'http://example.com/images/floatnright.png',

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

  7. 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: http://wordpress.org/extend/plugins/custom-tinymce/

  8. Alexander Zeiher
    Posted 5 years ago #

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

  9. 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).

Topic Closed

This topic has been closed to new replies.

About this Topic