WordPress.org

Ready to get started?Download WordPress

Forums

Changing default font tags in visual rich editor (18 posts)

  1. tgedny
    Member
    Posted 8 years ago #

    Hi.

    I'm setting up a blog for a client and wanted to amend the default tags entered by the Visual Rich Editor when a user enters or amends copy. At the moment this inserts. For example it may insert something like this:

    <p class="MsoNormal"><font size="2" face="Arial"><span lang="EN-GB" style="font-size: 10pt; font-family: Arial">

    Is there somewhere I can stop this form happening so the copy simply is inserted in:

    <p></p>

    tags?

    Thanks in advance for any help.

  2. Chris_K
    Member
    Posted 8 years ago #

    Stop copying from MS Word directly into the VRE. WP or the editor didn't add those tags. Word did.

    If you must compose articles in Word, at least copy and paste them to notepad before the blog to strip that office formatting out.

  3. Mark
    Member
    Posted 7 years ago #

    In WP2.1, hit ALT+V (IE) or ALT+SHIFT+V (Firefox) to toggle the Advanced Toolbar in the visual editor and use the 'paste as plain text' or 'paste from MS Word' buttons to clean up text from Word.

  4. Koldark
    Member
    Posted 7 years ago #

    How do you turn this on by default?

  5. theApe
    Member
    Posted 7 years ago #

    I've just removed line 45 of

    wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js

    return buttons+hiddenControls;

    I don't advise this and don't know what the side effects are, but it puts the button for switching the advance controls on and off on the end of the default buttons and so far I've had no ill effects.

    Also you need to shift+control Refresh in Firefox to see the change.

  6. theApe
    Member
    Posted 7 years ago #

    Just noticed you do lose the help button.

  7. xinfo
    Member
    Posted 7 years ago #

    the ape

    it's veru usefull tip's work well

    hide n show button replace the help button

  8. theApe
    Member
    Posted 7 years ago #

    Please be careful when modifying files, I do not know if this hack has any ill effects.

  9. theApe
    Member
    Posted 7 years ago #

    OK...

    I have a better solution, now I've had time to think about it. Do not do what is mentioned above, or undo if it has already been do.

    In line 31 of

    wp-includes/js/tinymce/plugins/tiny_mce_config.php

    Move the 'wp_adv' to before the 'wp_adv_start'

    Simple!

    Again shift+control Refresh in Firefox to see the change.

  10. theApe
    Member
    Posted 7 years ago #

    If you want all the buttons to show all the time just delete the 'wp_adv_start' and 'wp_adv_end' on line 31 of the same file.

    But please remember on your next upgrade it will return to normal unless you modify the file again after upgrading.

  11. alexarch
    Member
    Posted 7 years ago #

    I just upgraded to 2.1. The WYSIWYG editor on my Windows computer on Firefox is fine. The WYSIWYG editor on my Mac running OS 10.4.8 and Firefox has some of the buttons missing: blockquote, bullets, numbering, link, etc. I'm an idiot when it comes to code, so tabbing to the code view doesn't help. These missing buttons are not the advanced ones that show up with the 'control+v' I had a similar problem when I was running WordPress 1.7 on Safari. That's when a friend suggested I started using Firefox. That seemed to fix that problem.

    Thank you for any help you can give.

  12. SpeKopuZ
    Member
    Posted 7 years ago #

    Awesome, didn't know that one.

  13. ninjaboy
    Member
    Posted 7 years ago #

    Joy - just what I was looking for and about to post a query on!!

    Why this is not turned on by default I'll never know, good work guys!

  14. Sudar
    Member
    Posted 7 years ago #

    @alexarch,

    First empty your cache in FireFox and then go to the following menu in Firefox

    Go to Tools > Options > Content > Enable Javascript > Advanced > Make sure all these options are checked.

    I got this fix from this thread http://wordpress.org/support/topic/101716

    Hope this helps

    Cheers,
    Sudar

  15. Sudar
    Member
    Posted 7 years ago #

    Thanks theApe for the tip.

    But when we remove wp_adv_start and wp_adv_end all the buttons are displayed in a single line and it overflows out of the editor window. I tried to change that file a bit more and now it is fixed for me. If you are interested visit my site at http://sudarmuthu.com/blog/2007/02/11/wordpress-21-more-editing-options-in-wysiwyg-editor.html and you can grab the modified file.

  16. mihav
    Member
    Posted 7 years ago #

    Hi!

    I have a different solution, not necessarly better. I did not know of Alt-V option to show the extended toolbar though. It is better to have the "toolbar" icon present for some (who can't remember to press Alt-V shortcut). I've written about it here: http://www.mihavalencic.com/?p=7.

    In short, just add wp_adv before the rest of it. So line 57 would look like:
    theme_advanced_buttons1 : "wp_adv,<?php echo $mce_buttons; ?>",

    Miha

  17. trohrer
    Member
    Posted 7 years ago #

    If you want to make the advanced toolbar the default, and have it appear every time you can check my post on customizing the TinyMCE visual editor buttons in WordPress 2.1 at

    http://timrohrer.com/blog/?p=29

    There's also some instructions on how to customize the toolbar.

  18. dwest
    Member
    Posted 7 years ago #

    Tiny MCE as configured in WordPress 2.1 wipes away divs and replaces them with p tags.

    This can be fixed by doing the following:

    1-Open your TinyMCE config file in an editor. The file is located at:
    wp-includes/js/tinymce/plugins/tiny_mce_config.php

    2-Replace Line 25 with the following but on a single line:

    $valid_elements = '#p[*],-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]';

    3-Save the file back to your active WordPress installation, overwriting the existing tiny_mce_config.php file.

    4-In WordPress admin, the editor will now allow divs.

    You may have to refresh your editor page.

    As always, copy your original tiny_mce_config.php file to a safe place for backup before editing the original.

Topic Closed

This topic has been closed to new replies.

About this Topic