Skip to content

Instantly share code, notes, and snippets.

View bkaminski's full-sized avatar
🍺
IPA Time

Ben Kaminski bkaminski

🍺
IPA Time
View GitHub Profile
@bkaminski
bkaminski / bs5-modal.html
Last active January 29, 2022 06:42
Bootstrap 5 Modal Example
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
...
@bkaminski
bkaminski / jquery-math-rand.js
Last active January 29, 2022 06:04
jQuery for rotating Bootstrap modals
<script>
var modals = ["myModal1", "myModal2", "myModal3"];
var rand = modals[Math.random() * modals.length | 0];
jQuery(window).load(function(){
setTimeout(function() {
jQuery('#' + rand).modal('show');
}, 5000);
});
</script>
@bkaminski
bkaminski / bootstrap4x-helpers.css
Created May 18, 2018 17:46
Bootstrap 4x Helper Classes that are Not Included in Bootstrap 4x
/* Bootstrap 4x includes the class "text-white" now, but what about any other color? */
.text-gold {
color: #dec328;
}
/*
.text-any-color {
color: you-decide;
}
*/
@bkaminski
bkaminski / wp-pass-reset.php
Last active March 22, 2018 16:49 — forked from ivandoric/gist:e4e46294c4d35eac0ec8
wordpress: create custom reset password page
// With some Bootstrap 4 love. Of course, create a custom template for this.
<?php
/* do template stuff */
get_header(); ?>
<div class="card-body">
<?php
global $wpdb;
@bkaminski
bkaminski / bootstrap-carousel-v4.php
Last active January 17, 2019 09:08
WordPress Loop Inside Bootstrap 4.0.0 Carousel -- No Inline Styles
@bkaminski
bkaminski / contactform7-form.php
Last active February 20, 2018 16:22 — forked from iMazed/contactform7-form.php
Great for when you want to use FontAwesome in a submit button in Contact Form 7 (Revision)
//add instead of [submit] in Contact Form 7 (With Bootstrap 4 added)
<button type="submit" class="btn btn-lg btn-info btn-rounded">Send Message<i class="far fa-paper-plane fa-fw ml-3"></i></button>
// i class rather than <img src=""> with inline styles.
<i class="fas fa-spinner ajax-loader fa-pulse fa-4x"></i>
@bkaminski
bkaminski / cf7modalupdate03.js
Created September 6, 2017 21:59
CF7modalUpdate
$(document).ready(function($){
$(".bk-contact-modal").click(function(){
$("#contactModal").modal('show');
});
$('#contactModal').on('shown.bs.modal', function () {
$('#userName').focus();
});
});
@bkaminski
bkaminski / cf7modalupdate02.html
Created September 6, 2017 21:52
CF7modalUpdate
<!-- The include file with the "do_shortcode" hook -->
<!-- ID for modal set to "contactModal" for javaScript purposes -->
<div class="modal fade" id="contactModal" tabindex="-1" role="dialog" aria-labelledby="contactModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="contactModalLabel">Contact Ben:</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
@bkaminski
bkaminski / cf7modalupdate01.html
Created September 6, 2017 21:47
CF7modalUpdate
<!-- contact modal -->
<?php include get_template_directory() . '/inc/myexamplemodal.php'; ?>
<!-- \\\\\\\\\\\\\ SCRIPTS //////////// -->
<?php wp_footer(); ?>
</body>
</html>
@bkaminski
bkaminski / pgspecific02.php
Created September 2, 2017 15:44
WP Comments Page Specific
<?php if ( is_page( array( ID#, ID#, ID# ) ) )
comments_template( '', true ); ?>