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 | |
/** | |
* Returns the name of the photographer for the current post, along with a Font Awesome icon. | |
* | |
* @return string The name of the photographer for the current post, along with a Font Awesome icon. | |
*/ | |
function sjf_deh_get_photo_creds() { | |
// get the current post | |
$post = get_post(); |
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 | |
object(WP_Post)#29 (24) { | |
["ID"]=> int(161) | |
["post_author"]=> string(1) "1" | |
["post_date"]=> string(19) "2014-05-22 14:48:05" | |
["post_date_gmt"]=> string(19) "2014-05-22 14:48:05" | |
["post_content"]=> string(54) "Image description, with HTML" | |
["post_title"]=> string(11) "Image Title" | |
["post_excerpt"]=> string(13) "Image Caption" |
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 | |
/** | |
* Shortcode for a Masonry-powered WordPress image-gallery | |
* | |
* @param array $atts An array of WP shortcode args for post_id | |
* @return string A Masonry-powered WordPress image-gallery | |
*/ | |
function sjf_deh_gallery( $atts ){ | |
extract( shortcode_atts( array( |
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 | |
/** | |
* Given an attachment_id and a definition of portraiture, detect if a photo is a portrait | |
* | |
* @param int $attachment_id the attachment_id for the image | |
* @param mixed $max_ratio the aspect ratio that defines portraiture | |
* @return boolean returns true if image is a portrait, otherwise returns false | |
*/ | |
function sjf_deh_is_portrait( $attachment_id, $max_ratio='.67' ){ |
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 | |
/** | |
* Return a link to the next/prev post in a gallery | |
* | |
* @param string $next_prev Specify if the function should return the value for the next or the prev post | |
* @return string A link to the next/prev post in a gallery | |
*/ | |
function sjf_deh_get_adjacent_image_link( $next_prev = 'prev' ){ | |
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 | |
/** | |
* Standard practice among WordPress themes is to declare the width of the main content column as a global. | |
* | |
* @var integer | |
*/ | |
$content_width = 800; | |
/** |
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 | |
/** | |
* Save the Data | |
* | |
*/ | |
function sjf_deh_save_custom_meta( $post_id ) { | |
// Check if the nonce exists. | |
if( ! isset( $_POST[ 'sjf_deh_custom_meta_box_nonce' ] ) ) { return $post_id; } |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
... | |
<!-- styles added by sjf_deh_the_bg_image_styles() to position the page bg image --> | |
<style> | |
#page { | |
background: url(http://scottfennell.com/wp-content/uploads/2014/04/IMG_1405-2000x1333.jpg) no-repeat center center fixed; |
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
#page { | |
width: 100%; | |
height: 100%; | |
position: fixed; | |
left: 0; | |
right: 0; | |
top: 0; | |
bottom: 0; | |
} |