Advertisement
firoze

wp quicktags for bootstrap

May 21st, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. // add more buttons to the html editor
  2. // https://codex.wordpress.org/Quicktags_API
  3. function appthemes_add_quicktags() {
  4. if (wp_script_is('quicktags')){
  5. ?>
  6. <script type="text/javascript">
  7. QTags.addButton( 'bootstrap-container', 'Bootstrap Container','<div class="container">','</div>','<div>');
  8. QTags.addButton( 'bootstrap-row', 'Bootstrap Row','<div class="row">','</div>','<div>');
  9.  
  10. for(var i= 1;i<=12;i++){
  11. QTags.addButton( 'bt-col-md-'+i+'', 'bootstrap col md '+i+'','<div class="col-md-'+i+'">','</div>','<div>');
  12. }
  13. for(var i= 1;i<=12;i++){
  14. QTags.addButton( 'bt-col-lg-'+i+'', 'bootstrap col lg '+i+'','<div class="col-lg-'+i+'">','</div>','<div>');
  15. }
  16. for(var i= 1;i<=12;i++){
  17. QTags.addButton( 'bt-col-sm-'+i+'', 'Bootstrap col sm '+i+'','<div class="col-sm-'+i+'">','</div>','<div>');
  18. }
  19.  
  20. </script>
  21. <?php
  22. }
  23. }
  24. add_action( 'admin_print_footer_scripts', 'appthemes_add_quicktags' );
  25.  
  26. add_action('wp_head','bootstrap_css_func');
  27. function bootstrap_css_func(){
  28. ?>
  29. <link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
  30. <?php
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement