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
// Video Related Functions | |
function parseVideoUrl($search){ | |
//setup matcher | |
$matcher = '([a-zA-Z0-9-_]+)'; | |
//setup the patterns | |
$patterns = array( | |
'youtube\.com\/watch\?v\='.$matcher => 'youtube', | |
'youtu\.be\/'.$matcher => 'youtube', | |
'youtube\.com\/embed\/'.$matcher => 'youtube', |
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
<?php | |
// Get Video URL | |
$video_url = get_field( 'video_url' ); | |
// Get video ID | |
$video_data = parseVideoUrl( $video_url ); | |
// If YouTube | |
if ( $video_data['type'] == 'youtube' ) { |
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
<?php | |
// Get video data | |
include get_stylesheet_directory() . '/parts/template/video-data.inc.php'; | |
// Output video data | |
echo '<div class="small-embed">'. $video_embed . '</div>'; | |
// Caption | |
echo '<div class="caption">' . get_the_title() . '</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
<?php | |
remove_shortcode( 'video' ); | |
add_shortcode('videos', 'videos_shortcode'); | |
add_shortcode('video', 'videos_shortcode'); | |
function videos_shortcode( $atts ) { | |
extract(shortcode_atts(array( | |
'id' => '', | |
'url' => '' | |
), $atts)); |
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
<!doctype html> | |
<html> | |
<head> | |
<title>FEWD RULEZ!</title> | |
<link rel="stylesheet" href="css/style.css" /> | |
<style type="text/css"> | |
.menu { | |
background: #000; | |
position: fixed; | |
top: 0; |
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
<?php | |
// Get value for total_raised from Classy apc_inc | |
// https://www.classy.org/api1/account-info?cid=16294&token=82nfmamctkvewbU4FoMa | |
$json = file_get_contents('https://www.classy.org/api1/account-info?cid=16294&token=82nfmamctkvewbU4FoMa'); | |
$data = json_decode($json); | |
// Just Testin' Yall | |
// echo '<pre>'; print_r($data); echo '</pre>'; |
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
<!doctype html> | |
<html> | |
<head> | |
<title>To-Do App</title> | |
<link href='http://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" href="css/style.css" /> | |
</head> | |
<body> | |
<!-- START #to-do-app --> |
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
################################ | |
# START __posttype__ | |
################################ | |
function register__posttype__() { | |
$cpt_single = '__single__'; | |
$cpt_plural = '__plural__'; | |
$cpt_icon = '__icon__'; | |
$rewrite = array('slug' => '__slug__', 'with_front' => true); | |
$exclude_from_search = __exclude__; |
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
<?php | |
add_action( 'pre_get_posts', 'custom_get_posts' ); | |
function custom_get_posts( $query ) { | |
if( (is_category() || is_archive()) && $query->is_main_query() ) { | |
if ( $query->query_vars['post_type'] == 'staff' || $query->query_vars['post_type'] == 'stories' ) { | |
$query->query_vars['orderby'] = 'menu_order'; |
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
<header id="header"> | |
<div> | |
<div> | |
<a href="/" id="logo"> | |
<img src="logo.svg"> | |
</a> | |
<h1>Page Title</h1> | |
</div> | |
<div> | |
<a id="show-dropdown" href="#header-dropdown">MENU</a> |