This file contains hidden or 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
function save_upload( $_FILES = false ) { | |
$photos = array(); | |
if( $_FILES ) { | |
$allowedExts = array("gif", "jpeg", "jpg", "png"); | |
foreach( $_FILES as $name=>$photo ) { | |
$temp = explode(".", $photo["name"]); |
This file contains hidden or 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
<?php | |
function no_orphans( $title ) { | |
global $post; | |
if( $title == $post->post_title ){ | |
//Take apart | |
$title_words = explode(' ', $title); | |
$tile_without_last_word = array_slice($title_words, 0, -1); | |
$last_word = array_slice($title_words, -1, 1); |
This file contains hidden or 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
<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>"> | |
<label for="searchField" class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></label> | |
<div class="input-group"> | |
<input type="search" id="searchField" class="search-field" | |
placeholder="<?php echo esc_attr_x( 'Search the site for…', 'placeholder' ) ?>" | |
value="<?php echo get_search_query() ?>" name="s" | |
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" /> | |
<span class="input-group-btn"> | |
<button type="submit" class="btn btn-default"> | |
<?php echo esc_attr_x( 'Search', 'submit button' ) ?> |
This file contains hidden or 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
AliceBlue | AntiqueWhite | Aqua | Aquamarine | Azure | Beige | Bisque | Black | BlanchedAlmond | Blue | BlueViolet | Brown | BurlyWood | CadetBlue | Chartreuse | Chocolate | Coral | CornflowerBlue | Cornsilk | Crimson | Cyan | DarkBlue | DarkCyan | DarkGoldenRod | DarkGray | DarkGrey | DarkGreen | DarkKhaki | DarkMagenta | DarkOliveGreen | Darkorange | DarkOrchid | DarkRed | DarkSalmon | DarkSeaGreen | DarkSlateBlue | DarkSlateGray | DarkSlateGrey | DarkTurquoise | DeepPink | DeepSkyBlue | DimGray | DimGrey | DodgerBlue | FireBrick | FloralWhite | ForestGreen | Fuchsia | Gainsboro | GhostWhite | Gold | GoldenRod | Gray | Grey | Green | GreenYellow | HoneyDew | HotPink | IndianRed | Indigo | Ivory | Khaki | Lavender | LavenderBlush | LawnGreen | LemonChiffon | LightBlue | LightCoral | LightCyan | LightGoldenRodYellow | LightGray | LightGrey | LightGreen | LightPink | LightSalmon | LightSeaGreen | LightSkyBlue | LightSlateGray | LightSlateGrey | LightSteelBlue | LightYellow | Lime | LimeGreen | Linen | Magenta | Maroon | MediumAquaMarine | MediumBlue | MediumOrchid | MediumPurple | MediumSeaGreen | MediumSlateBlue | MediumSpringGreen | MediumTurquoise | MediumVioletRed | MidnightBlue | MintCream | Mis |
---|
This file contains hidden or 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
document.querySelectorAll("[data-scroll]").forEach(el => { | |
el.addEventListener('click', () => document.querySelector(el.dataset.scroll).scrollIntoView(true)); | |
}); |
This file contains hidden or 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
.image { | |
width: 200px; | |
height: 200px; | |
background: no-repeat center center; | |
background-image: url(https://images.unsplash.com/photo-1464823063530-08f10ed1a2dd?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=f0976bd6d336e2aeb5e06dbc366515ea&auto=format&fit=crop&w=1650&q=80); | |
background-size: cover; | |
position: relative; | |
&:after { | |
content: ""; | |
display: block; |
This file contains hidden or 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
/* | |
* <button data-toggle-class="#targetDiv:some-class">Toggle this Class on the Element</button> | |
*/ | |
$("[data-toggle-class]").on('click', function(e){ | |
e.preventDefault(); | |
const config = $(this).data('toggle-class').split(':'); | |
const $target = $(config[0]); | |
const className = config[1]; |
This file contains hidden or 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
@mixin breakout() { | |
width: 100vw; | |
position: relative; | |
left: 50%; | |
right: 50%; | |
margin-left: -50vw; | |
margin-right: -50vw; | |
} |
This file contains hidden or 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
<?php | |
/** | |
* Allow filtering of index/archives by GET | |
* Example) Adding ?sort=-date will sort posts descending by date. | |
* Possible Values: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters | |
*/ | |
add_action('pre_get_posts', function ($query) { | |
if( $query->is_main_query() ) { | |
$sort = "relevance"; | |
$order = "DESC"; |
This file contains hidden or 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
$("[data-autosubmit]").on('change', function(){ | |
$(this).parents("form").submit(); | |
}); |
OlderNewer