Skip to content

Instantly share code, notes, and snippets.

View elsonponte's full-sized avatar

Elson Ponte elsonponte

View GitHub Profile
@smutek
smutek / Bootstrap4Nav-Sage9.md
Last active July 30, 2022 06:50
Bootstrap 4 Walker for Sage 9

Credit

This is a frankensteind version of the current Soil nav walker, by the Roots team, and Michael Remoero's Sagextras walker. All credit goes to those good folks. :)

Use

  • Replace the contents of header.blade.php with the attached header.
  • Copy the walker.php file to the /app directory.
  • Add walker.php to the Sage required files array in resources/functions.php - eg. on a stock Sage install the entry would look like:
/**
//add_action('wp_head', 'update_meta_values');
function update_meta_values() {
/*
* Takes a set of fields and resets them as part of a repeater
* To start, create a new repeater field and enter the slug in $new_repeater
* Find the fields you would like to move in wp_posts and set the post_parent to the new repeater's ID
*/
// Slug of the new repeater
@piperhaywood
piperhaywood / apprch-wp-srcset.php
Last active November 28, 2021 23:24
WordPress function to create HTML5 image element with 'srcset' and 'sizes' attributes for JPEGs and PNGs. Paste in to functions.php for use elsewhere in theme.
/**
* WordPress function to create HTML5 image element with 'srcset' and 'sizes' attributes for JPEGs and PNGs.
* Paste in to functions.php for use elsewhere in theme. Images in 'srcset' are created from all WordPress registered image sizes.
* Mime types 'image/jpg', 'image/png', and 'image/gif' are returned appropriately.
*
* @author Piper Haywood <piper@approach.co.uk>
* @link http://piperhaywood.com
* @link https://gist.github.com/piperhaywood/96ac07ea5f4999512275
*
* @example https://gist.github.com/piperhaywood/686cc0c788bd9fc3fa6e
@studiopress
studiopress / pinterest-after.php
Last active June 28, 2018 17:17
Pinterest "Pin It" Button.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
add_action( 'genesis_entry_content', 'sp_custom_pinterest_button' );
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">