WordPress.org

Forums

Bootstrap Shortcodes for WordPress
[resolved] prevent auto include (7 posts)

  1. Anisi
    Member
    Posted 1 year ago #

    could you please add an option to disable auto-include bootstrap files in header and footer. for situations that template's base is bootstrap and it has already the bootstrap files included in it.

    https://wordpress.org/plugins/bootstrap-3-shortcodes/

  2. Michael W.
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, Anisi,
    If you check out the FAQ (http://wordpress.org/plugins/bootstrap-3-shortcodes/faq/) this plugin actually doesn't include the Bootstrap files at all on the front end. This plugin actually requires the user to be using a theme built with Bootstrap exactly as you suggest.

    This plugin does include the Bootstrap files in the WordPress back-end so that it can style its documentation.

    Are you having a particular problem or conflict with a theme? I'd be happy to take a look.

  3. Anisi
    Member
    Posted 1 year ago #

    thanks for your response.
    but this code is included in the footer:

    <script type='text/javascript' src='http://ituts.ir/wp-content/plugins/bootstrap-3-shortcodes/includes/js/bootstrap-shortcodes-tooltip.js'></script>
    <script type='text/javascript' src='http://ituts.ir/wp-content/plugins/bootstrap-3-shortcodes/includes/js/bootstrap-shortcodes-popover.js'></script>
  4. Michael W.
    Member
    Plugin Author

    Posted 1 year ago #

    Ah, I see the confusion. Those files contain the triggering code for Tooltip and Popover (see details here and here). This code is not part of the Bootstrap libraries, and, as noted in the Bootstrap documentation:

    Opt-in functionality
    For performance reasons, the Tooltip and Popover data-apis are opt-in, meaning you must initialize them yourself.

    Since this additional code must be written specifically for the classes or IDs of the tooltip and popover elements, that additional javascript is included in our plugin to match the way we class those components.

    If your theme already includes customized triggering code for Tooltip and Popover that matches the markup generated by this plugin, I would recommend dequeuing those two scripts in your theme's functions.php:

    wp_dequeue_script( 'bootstrap-shortcodes-tooltip' );
    wp_dequeue_script( 'bootstrap-shortcodes-popover' );
  5. Michael W.
    Member
    Plugin Author

    Posted 1 year ago #

    I can add that we are investigating conditionally loading these scripts only when one or both of those shortcodes are used on a particular page, but we don't have a timeframe for when we'll be able to ship that functionality.

  6. Anisi
    Member
    Posted 1 year ago #

    thank you so much

  7. Michael W.
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for using our plugin! If you like it please consider submitting a review here on WordPres.org.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.