AnswerBun.com

How to make float element in tinymce

WordPress Development Asked by KeizerBridge on January 6, 2022

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 ?

One Answer

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.

Answered by jimihenrik on January 6, 2022

Add your own answers!

Related Questions

Can I have multiple database users within WordPress?

1  Asked on January 6, 2022 by shady-m-rasmy

   

How to make float element in tinymce

1  Asked on January 6, 2022 by keizerbridge

   

Site Tagline ended up in permalink

1  Asked on January 6, 2022 by alvsa

   

Remove/hide a specify category-name from the url

2  Asked on January 4, 2022 by andresgl

     

Comments waiting but no comments found

3  Asked on January 4, 2022 by athoxx

   

Ajax load more button for comments wordpress

1  Asked on January 4, 2022 by trello

         

WordPress site not working after move

2  Asked on January 2, 2022 by patrick-bateman

 

How to exclude post body from WP search

1  Asked on January 2, 2022 by nstampler

 

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP