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 nav menu without markup containers | |
* | |
* @uses wp_nav_menu() | |
* @param string $menu The name given to the menu in Appearance > Menus | |
* @param integer $depth | |
* @return string | |
*/ |
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_filter( 'image_send_to_editor', 'pilau_protocol_relative_image_urls', 999999 ); | |
/** | |
* Filter images sent to editor to make the URLs protocol-relative for possible SSL | |
*/ | |
function pilau_protocol_relative_image_urls( $html ) { | |
// Replace protocols with relative schema | |
$html = str_replace( array( 'http://', 'https://' ), '//', $html ); |
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 the URL of a thumbnail for a video on a 3rd-party service | |
* | |
* @param string $url Currently supports YouTube and Vimeo | |
* @return string | |
*/ | |
function pilau_get_video_thumbnail( $url ) { | |
$thumb_url = null; |
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
/** | |
* Slideshow | |
*/ | |
( function( $ ) { | |
$.PilauSlideShow = function( options ) { | |
/** The slideshow wrapper element */ | |
this.el = options.el; |
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
ul { | |
padding-left: 1.5em; | |
li { | |
list-style: none; | |
&:before { | |
content: '\2022'; | |
color: @color-green; | |
display: block; | |
position: relative; | |
max-width: 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 | |
/** | |
* Custom blog pagination links | |
* | |
* @return void | |
*/ | |
function pilau_posts_nav_link() { | |
global $wp_query; | |
$max_num_pages = $wp_query->max_num_pages; |
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
<!-- Begin MailChimp Signup Form --> | |
<div id="mc_embed_signup"> | |
<form action="[grab the URL from the MC form builder]" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"> | |
<div id="field-firstname" class="field"> | |
<label for="mce-FNAME" class="assistive-text"><?php _e( 'First name' ); ?></label> | |
<input type="text" value="" name="FNAME" class="input" id="mce-FNAME" placeholder="<?php _e( 'First name' ); ?>"> | |
</div> | |
<div id="field-lastname" class="field"> | |
<label for="mce-LNAME" class="assistive-text"><?php _e( 'Last name' ); ?></label> | |
<input type="text" value="" name="LNAME" class="input" id="mce-LNAME" placeholder="<?php _e( 'Last name' ); ?>"> |
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 data with caching | |
* | |
* Change function name, transient name, and cache timeout if necessary. | |
* Populate $my_data, obviously. | |
* "refresh" query parameter useful for manual refreshing. | |
*/ | |
function pilau_get_my_data() { |