Skip to content

Instantly share code, notes, and snippets.

View jakefentress's full-sized avatar

Jake Fentress jakefentress

View GitHub Profile
@jakefentress
jakefentress / network.php
Created May 14, 2014 18:44
WordPress Multisite Network Info
<?php if( is_multisite() ): ?>
The <a href="<?php echo esc_url( get_site_option( 'siteurl' ) ); ?>"><?php echo esc_html( get_site_option( 'site_name' ) ); ?> network</a> currently powers <strong><?php echo get_blog_count(); ?></strong> websites and <strong><?php echo get_user_count(); ?></strong> users.
<?php endif; ?>
@jakefentress
jakefentress / svg-fallback.html
Created February 20, 2014 17:04
Inline SVG Fallbacks - especially for problems with IE9
<!--[if gt IE 9]><!-->
<img src="img/wordmark.svg" onerror="this.src=img/wordmark.png;this.onerror=null;">
<!--<![endif]--><!--[if lte IE 9]>
<img src="img/wordmark.png">
<![endif]-->
@jakefentress
jakefentress / yepnope.html
Created February 19, 2014 19:47
Loading jQuery and main JavaScript files with YepNope
<!-- jQuery and Global Functionality -->
<script>
yepnope([{
load: '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js',
complete: function () {
if (!window.jQuery) {
yepnope('/vendor/jquery/dist/jquery.min.js');
}
}
}, {
@jakefentress
jakefentress / typekit.html
Created February 19, 2014 19:42
Loading TypeKit with YepNope
<script>
yepnope.injectJs('//use.typekit.net/yiy1stl.js', function() { try{Typekit.load();}catch(e){} });
</script>
@jakefentress
jakefentress / relative.liquid
Created February 19, 2014 19:39
Relative links in Jekyll
{% capture lvl %}{{ page.url | append:'index.html' | split:'/' | size }}{% endcapture %}
{% capture relative %}{% for i in (3..lvl) %}../{% endfor %}{% endcapture %}
{% comment %} note the {{ relative }} tag in the URL below {% endcomment %}
<link rel='stylesheet' href='{{ relative }}css/screen.css'>