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
| .youtube-video-wrap { | |
| width: 100%; | |
| max-width: 640px; | |
| margin: 3rem auto; | |
| } | |
| .video-container { | |
| position: relative; | |
| padding-bottom: 56.25%; //16:9 aspect ratio, 9/16 = .5625. Padding is percentage of container width | |
| height: 0; | |
| overflow: hidden; |
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
| /** | |
| * Helper function for getting the widths and url's of all the available crops of an image. | |
| * @param Number $id: The id of the image that you need the info for | |
| * @return Array An associative array with array["widths"] containing an array of widths and array["urls"] containing the corresponding image urls. | |
| */ | |
| function get_image_widths_and_urls($id) { | |
| //Get all the possible image sizes | |
| $image_size_array = get_intermediate_image_sizes(); | |
| //error_log('--------------------$image_size_array------------------------'); | |
| //error_log( var_export($image_size_array, 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
| /** | |
| * Returns a string of an <img> tag with src, srcset and sizes attributes set. | |
| * @param $attachment_id int The WordPress id for the attachment. | |
| * @param $alt_string String The alt string for the image tag, e.g. "My image" | |
| * @param string $class_string A string of classes to apply to the <img> | |
| * @param array $sizes_to_exclude An array of strings, where each string is a named WordPress intermediate image size that you want to exclude from the srcset attribute. | |
| * @param string $sizes_string The string that will become the sizes attribute of the <img> | |
| * @return string | |
| */ | |
| function create_responsive_img_tag( $attachment_id = -1, $alt_string = '', $class_string = '', $sizes_to_exclude = [], $sizes_string = '' ) { |
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
| /** | |
| * Helper function for getting the widths and url's of all the available crops of an image. | |
| * @param Number $id : The id of the image that you need the info for | |
| * @param Array $image_sizes_to_exclude An array of strings with the names of image sizes to exclude from the output | |
| * @return Array An indexed array, where at each index there is an associative array with array["width"] containing an image width and array["url"] containing the corresponding image url. | |
| * Example: Array( | |
| * [0] => Array( | |
| * [width] => 300 | |
| * [url] => http://placehold.it/50x50 | |
| * ), |
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
| /** | |
| * Given a jQuery selector string corresponding to a collection of images, moves the values from the image attributes | |
| * data-srcset and data-sizes to srcset and sizes, thus loading the appropriate images in a deferred manner. Requires | |
| * jQuery. | |
| * @param String selector A String used as a jQuery selector for a collection of images. | |
| * @param startIndex The start index of the subset of the images you want to load from the collection returned from the | |
| * selector string. | |
| * @param endIndex The end index of the subset of the images you want to load from the collection returned from the | |
| * selector string. Put the same value for startIndex and endIndex if you only want a single image to be loaded. | |
| * If not supplied, will be calculated as the last index in the collection. |
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
| /***************CUSTOMIZE THE THEME CUSTOMIZER************/ | |
| function refinestl_customize_register( $wp_customize ) { | |
| // Do stuff with $wp_customize, the WP_Customize_Manager object. | |
| $wp_customize->add_section( 'logo_section', array( | |
| 'title' => __( 'Logos', 'textdomain' ), | |
| 'priority' => 101, | |
| ) ); | |
| $wp_customize->add_setting( 'site_logo', array( | |
| 'type' => 'theme_mod', |
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
| .call-to-action { | |
| background-color: $fawn; | |
| padding-bottom: 2em; | |
| padding-top: 2em; | |
| @include breakpoint(medium) { | |
| padding-left: 15%; | |
| padding-right: 15%; | |
| } | |
| h6 { | |
| width: 55%; |
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
| You will need to place your public SSH key on the server for authentication for this to work. | |
| See this article: https://www.digitalocean.com/community/tutorials/how-to-copy-files-with-rsync-over-ssh | |
| rsync -rv -e 'ssh -p 1111' user@SOURCE:/path/ /Users/brianblosser/DESTINATION/ | |
| Use rsync to transfer files from an FTP source to a local destination | |
| -r: recurse into directories | |
| -v: verbose |
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
| /** | |
| * If this mixin is applied to an <img> tag that is a child of a parent element | |
| * with a fixed height or changing aspect ratio, it will scale the image to cover | |
| * the smallest dimension, and crop the image through the overflow: hidden | |
| * rule on the parent. | |
| * You must apply the mixin image-cover-parent to the parent in order for | |
| * image-cover to work on the child. | |
| */ | |
| @mixin image-cover() { | |
| display: block; |
OlderNewer