Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Christensen Firestorm980

View GitHub Profile
View html-test-markup.html
<div id="top" class="page" role="document">
<header role="banner">
<h1>HTML5 Test Page</h1>
This is a test page filled with common HTML elements to be used to provide visual feedback whilst building CSS systems and frameworks.
</header>
<nav role="navigation">
<ul>
<li><a href="#text">Text</a>
<ul>
View custom_wp_scripts_styles.php
/*
The trick to this whole thing is the cache busting "filemtime()" function.
It takes the file creation time and makes that the version number.
So, we don't have to keep track of versions and it will always be unique.
*/
// You don't have to define this stuff, but it can be useful for later since we reference them so much.
define( 'THEME_DIR_URI', get_template_directory_uri() );
define( 'THEME_DIR', get_template_directory() );
View jquery.orphans.js
/**
* This script is modified from Ricardo Zea: http://codepen.io/ricardozea/pen/qcDCJ
* His was a modified script from CSS-Tricks: https://css-tricks.com/preventing-widows-in-post-titles/
* It should be able to modify the last word of the selector and make it so there is no orphan when there is no room using the &nbsp; trick.
* May adapt it into a plugin.
*/
jQuery(document).ready(function($) {
$('p').each(function() {
var wordArrayRaw = $(this).html().split(' '); // Get an array of words
var wordArray = wordArrayRaw.filter(function(n){ return (n !== undefined && n !== ''); }); // Filter out the bad