• Dear,

    O boy i hate WYSIWYG editors and TinyMCE things, but for this one client i just need to fix them because they don’t understand html.

    What i’m doing is simple, just add a div Style with a class to the TinyCME Style format.
    This way it should-/should be easy for this client to select a few paragraphs of text and just hit Column Left from the Style format menu-bar (TinyMCE) and that would style all those paragraphs into a left column on the website, after that he should do the same > select > hit Right column en that would make text go to the rich-side of the website.
    I need to make 2 columns in the content-entry div to post in.

    Only problem i face is that WP cuts all paragraphs and redoes the div class=”column-left”> … </div> style instead of making them <p> … </p>

    This is how it looks now because WP automatically cuts and restarts the paragraphs.

    <div class="column-left">
    Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen.
    </div>
    <div class="column-left">
    Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw.
    </div>

    While it should output this code:

    <div class="column-left">
    <p>Lorem Ipsum is slechts een proeftekst uit het drukkerij- en zetterijwezen.</p>
    
    <p>Lorem Ipsum is de standaard proeftekst in deze bedrijfstak sinds de 16e eeuw.</p>
    </div>

    This is very frustrated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Suggestion:
    Add a second class with the post ID so you get "column-left postid-123"

    There are also plugins that will split a post into multiple columns, worth look and a Google.

    HTH

    David

    You can also code the structural markup into your template, and then use the <!–next page–> feature to break the content up in the WYSIWYG editor.

    <div class="column-left">
       <?php the_content;?>
    </div>
    <div class="column-left">
        <?php global $page; $page = 2; the_content(); ?>
    </div>

    You can get the page break button back with this:

    add_filter( 'mce_buttons', 'my_wysiwyg_editor' );
    
    function my_wysiwyg_editor($mce_buttons) {
        $pos = array_search( 'wp_more', $mce_buttons, true );
        if ($pos !== false) {
            $tmp_buttons = array_slice( $mce_buttons, 0, $pos+1 );
            $tmp_buttons[] = 'wp_page';
            $mce_buttons = array_merge( $tmp_buttons, array_slice( $mce_buttons, $pos+1 ) );
        }
        return $mce_buttons;
    }
    Thread Starter Jaja..

    (@jaja-1)

    @ Digital Raindrops,

    Thanks for your help,
    But please no plugins for me on this i’ve tried a few and most of them made a mess of the source-code and some added multiple input content fields to your admin-screen. ?really what if you would like 6 column? X => six content input fields! ??

    + If i can teach a client to type shortcodes like this: [column=1] .. [/column] i think i’m at the same level as teaching him real HTML. It’s all about understanding open and closing tags.

    It has to be added by a single button like how MS WORDS or MS Office works.
    Just Select (highlight) some text and push a button to move content to the left or right-side of the webpage.

    @ Jackson,

    Hmm sounds interesting!
    But this would leave me with a few empty <divs> in my source code when he just uses only one column. True?

    Like what if i say you can max. make 6 columns and he would only use one or two of the six this would give me 4 other empty div styles in my source code.


    I know i’m asking much but i really would just like to know WHY aren’t the P tags visible in the HTML editor?

    Example:
    If i’m working in Visual editor (i was just trying a few minutes ago)
    And i start typing: Hello this is my title.

    After that i select or highlight, Hello this is my title and after that i push the Format > Heading 2 option. That would make it bold and when i take a sneak peak at the HTML editor i see that WordPress has added <h2>Hello this is my title</h2>
    to the editor.

    GREAT feature!

    Why can’t i do the same with the Paragraph tag?
    Just wrap some text and add a P tag to it.

    Why does WordPress waits till you push on publish to add this P tags.
    If WordPress would just added ‘LIVE’ in the editor P tags like it does with all other codes i think i would solve my problem here.

    Because if All content was closed in <p> blabla </p> and i would select or highlighted lets say 3 paragraphs, WordPress would easily wrap all those 3 paragraphs into a Style > Div = class=”column-left”.

    You could use the global $pages to determine the total number and output your code accordingly to avoid empty <div>s

    Thread Starter Jaja..

    (@jaja-1)

    Okay,

    Let me go and search if i can find more info on the <!– next page –> function in combination wit multiple contents.

    Thanks.

    Thread Starter Jaja..

    (@jaja-1)

    I’ve found it!

    Just like you said!
    some times i’m just thinking too big out of the box.

    For people who would like a tutorial while doing this.

    Thanks again.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can you STOP WP from cutting my Paragraphs?’ is closed to new replies.