A mixin for writing @font-face rules in SASS.
Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.
@include font-face(Samplino, fonts/Samplino);
<?php | |
if (in_array($_SERVER['REMOTE_ADDR'], ['::1', '127.0.0.1'])) { | |
// localhost | |
} else if ('staging.example.com' == $_SERVER['HTTP_HOST']) { | |
// staging | |
} |
<?php | |
if (! function_exists('is_ssl')) : | |
/** | |
* Check if SSL is enabled. | |
*/ | |
function is_ssl() | |
{ | |
if (is_ssl()) { | |
return true; |
<?php | |
/** | |
* Get yoast primary (or 1st found) category. | |
*/ | |
function get_yoast_primary_category($post_id=0) | |
{ | |
// If no category is set, return fasle. | |
if ( ! $category = get_the_category( $post_id ?: get_the_ID() ) ) { | |
return false; |
(function( $ ) { | |
'use strict'; | |
var $doc = $(document); | |
var module = { | |
init : function() { | |
this.createElements(); | |
this.cacheProps(); |
/** | |
* Masking with equilateral triangles in CSS | |
*/ | |
body{ | |
background: #fff; | |
min-height: 100%; | |
} | |
/* |
<?php | |
/* Register custom post types on the 'init' hook. */ | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 0.1.0 | |
* @access public |
<?php | |
function better_wp_post_content( $word_limit=false, $force_excerpt=false, $do_shortcode=false ) { | |
$post = get_post(); | |
$excerpt_metabox = $post->post_excerpt; | |
// If word limit was used, return the excerpt. | |
if ( is_int( $word_limit ) ) : | |
$excerpt = $force_excerpt ? $excerpt_metabox : get_the_excerpt(); |
.print-only { display: none !important; } | |
@media print { | |
.hide-on-print { display: none !important; } | |
.print-only { display: block !important; } | |
} |