Skip to content

Instantly share code, notes, and snippets.

@jcook3195
jcook3195 / nav.php
Created February 18, 2019 13:21
Bootstrap navigation with Codeigniter base_url function calls.
<nav class="navbar navbar-expand-lg bg-primary">
<div class="container">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainNav" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"><i class="fas fa-bars"></i></span></button>
<div class="collapse navbar-collapse" id="mainNav">
<div class="navbar-nav">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item">
<a class="nav-link" href="<?php echo base_url(); ?>">Home</a>
</li>
<li class="nav-item">
@jcook3195
jcook3195 / blowfish_hash.php
Last active February 11, 2019 13:49
Hashing a password with Blowfish, then checking if the entered password matches.
<?php
/**
* Hashing the password at the time of the registration
*/
// Call function to hash the registration password (then enter it into the database however you choose)
blow_hash($_POST['password'])
// Hash passwords with blowfish
function blow_hash($password) {
@jcook3195
jcook3195 / product-thumbnails.php
Last active November 5, 2018 13:18
Fixing WooCommerce Featured Product Image Displaying Multiple Times in Gallery
<?php
defined( 'ABSPATH' ) || exit;
// Note: `wc_get_gallery_image_html` was added in WC 3.3.2 and did not exist prior. This check protects against theme overrides being used on older versions of WC.
if ( ! function_exists( 'wc_get_gallery_image_html' ) ) {
return;
}
global $product;
@jcook3195
jcook3195 / dry-if.js
Created November 8, 2016 13:00
JS FizzBuzz Solutions
//DRY option
function fizzBuzz() {
var output;
for(var i=1; i<=20; i++;) {
output='';
if(i%3 === 0){
output+='Fizz';
}
if(i%5 === 0){
output+='Buzz';
@jcook3195
jcook3195 / genesis-footer-override.php
Created November 2, 2016 12:07
Override Default Genesis Footer
@jcook3195
jcook3195 / custom-post-template.php
Last active September 19, 2017 09:04
Template for Custom Post with CPTUI
<?php
/**
* Template Name: Custom Template -- Replace this with your post type title
*/
remove_action('genesis_loop', 'genesis_do_loop'); //Remove the default custom post type loop
add_action('genesis_loop', 'custom_post_loop'); //Add custom post type loop
remove_action('genesis_before_post_content', 'genesis_post_info'); //Stop post page from displaying the post info (date, comments, etc.)
remove_action('genesis_after_post_content', 'genesis_post_meta'); //Stop post page from displaying the post meta (category, tags, etc.)