This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ol class="list-ordered"> | |
<li class="list-item">List item 1</li> | |
<li class="list-item">List item 2</li> | |
<li class="list-item">List item 3</li> | |
<li class="list-item">List item 3</li> | |
</ol> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add custom post types to the home and blog pages | |
// change 'cpt1' and 'cpt2' to your post type names | |
add_filter( 'pre_get_posts', 'my_get_posts' ); | |
function my_get_posts( $query ) { | |
if ( is_home() && $query->is_main_query() ) | |
$query->set( 'post_type', array( 'post', 'cpt1', 'cpt2' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
background: url('http://placebear.com/1200/800') no-repeat center center fixed; | |
background-size: cover; | |
height: 100%; | |
overflow: hidden; | |
} | |
body { | |
height:100%; | |
overflow: scroll; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- background-size-polyfill v0.2.0 | (c) 2012-2013 Louis-Rémi Babé | MIT License --> | |
<PUBLIC:COMPONENT lightWeight="true"> | |
<PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="o.init()" /> | |
<PUBLIC:ATTACH EVENT="ondocumentready" ONEVENT="o.init()" /> | |
<PUBLIC:ATTACH EVENT="onpropertychange" ONEVENT="o.handlePropertychange()" /> | |
<PUBLIC:ATTACH EVENT="ondetach" ONEVENT="o.restore()" /> | |
<PUBLIC:ATTACH EVENT="onresize" FOR="window" ONEVENT="o.handleResize()" /> | |
<PUBLIC:EVENT NAME="onbackgroundupdate" ID="updateEvent" /> | |
<script type="text/javascript"> | |
var o;!function(a,b){var c=/url\(["']?(.*?)["']?\)/,d=/^\s\s*/,e=/\s\s*$/,f=/\s\s*/g,g=/%$/,h={top:0,left:0,bottom:1,right:1,center:.5},i=a.document,j="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",k="background-size-polyfill",l=function(){},m=100,n,p,q,r;function s(){var b=i.createElement("div"),c=i.createElement("img"),d=b.style,e=a.style,f=a.currentStyle,g=a.bgsExpando,h=a.firstChild;g&&(g.restore&&(e.backgroundImage=g.restore.back |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="responsive-container responsive-container--square"> | |
<img class="vertically-centered" src="path/to/image.jpg" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add region query variable | |
add_filter('query_vars', 'introduce_region_qv'); | |
function introduce_region_qv($qv) { | |
$qv[] = 'job_region'; | |
return $qv; | |
} | |
// filter relevanssi based on job_region query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_enqueue_scripts', 'load_your_css'); | |
function load_your_css(){ | |
if(!is_admin()){ | |
$css_link = get_stylesheet_directory_uri() . '/style.css'; | |
$css_file = get_stylesheet_directory() . '/style.css'; | |
wp_enqueue_style('theme-style', $css_link, array(), filemtime($css_file), 'all'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add excerpt link to custom excerpts | |
function add_read_more_to_custom_excerpts($excerpt) { | |
// set up the global post variable | |
global $post; | |
if ( !empty( $post->post_excerpt ) ) { | |
$excerpt = $excerpt . '<br/><a href="' . get_permalink() . '">> Read more</a>'; // change this to suit your theme | |
} | |
return $excerpt; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<img src="tomato.svg" onerror="this.src='tomato.png'; this.onerror=null;"> |
OlderNewer