2

I would know how its possible to add a float:left or float:right in tinymce ? I know how to do this for a picture but what is the best solutions for all elements ?

1 Answer 1

0

You could add custom quick tags (for the text editor) easily as follows

function wpse182089_add_float_quicktags() {
    if (wp_script_is('quicktags')){ ?>
        <script type="text/javascript">
        QTags.addButton( 'floatr', 'float right', '<span style="float: right">', '</span>', '', '', 41 );
        QTags.addButton( 'floatl', 'float left', '<span style="float: left">', '</span>', '', '', 42 );
        </script>
    <?php }
}
add_action( 'admin_print_footer_scripts', 'wpse182089_add_float_quicktags' );

You could change the span to div if you want to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.