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 // functions.php | |
| // Adds function to convert dates to time ago format. Ex: "2 weeks ago" | |
| // $post_date = post date | |
| function cssgirl_time_ago($post_date) { | |
| global $post; | |
| $post_date = strtotime( $post_date ); | |
| return human_time_diff( $post_date, current_time( 'timestamp' ) ).' '.__( 'ago' ); // 'ago' can be a different string of text | |
| } | |
| ?> |
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
| {% set summary = "Item Summary. Sed porttitor lectus nibh. Quisque velit nisi, pretium ut lacinia in, elementum id enim. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus suscipit tortor eget felis porttitor volutpat. Vivamus magna justo, lacinia eget consectetur sed, convallis at tellus. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Curabitur arcu erat, accumsan id imperdiet et, porttitor at sem. Donec sollicitudin molestie malesuada. " %} | |
| {{ summary|length > 160 ? summary|slice(0, 161)|split(' ')|slice(0, -1)|join(' ') ~ '...' : summary }} | |
| {{ summary }} |
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 | |
| $summary = "String of text. Proin eget tortor risus. Mauris blandit aliquet elit, eget tincidunt nibh pulvinar a. Praesent sapien massa, convallis a pellentesque nec, egestas non nisi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec velit neque, auctor sit amet aliquam vel, ullamcorper sit amet ligula. Donec rutrum congue leo eget malesuada. Curabitur aliquet quam id dui posuere blandit. Donec sollicitudin molestie malesuada."; | |
| $summary = substr($summary, 0, (160 - 3)); | |
| $summary = preg_replace('/ [^ ]*$/', '...', $summary); | |
| echo $summary; | |
| ?> |
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
| $(".nav__link[href^='#']").on('click', function(e) { | |
| e.preventDefault(); | |
| $('html, body').animate({ | |
| // replace 60 with height + margin for header | |
| scrollTop: $(this.hash).offset().top - 110 | |
| }, 300, function(){ | |
| }); | |
| }); |
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 acf_apply_content_filter_for_api($value, $post_id, $field){ | |
| return str_replace( ']]>', ']]>', apply_filters( 'the_content', $value) ); | |
| } | |
| function add_content_filter_ACF(){ | |
| if(!is_admin()){ | |
| remove_all_filters('acf/format_value/type=wysiwyg'); | |
| add_filter('acf/format_value/type=wysiwyg', 'acf_apply_content_filter_for_api', 10, 3); | |
| } | |
| } | |
| add_action('init', 'add_content_filter_ACF'); |
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
| /* Colors from base.css */ | |
| $black: #000; | |
| $white: #fff; | |
| $offwhite: #dedede; | |
| $offwhite2: #f8f8f8; | |
| $offwhite3: #f7f6f5; | |
| $offwhite4: #e5e5e5; | |
| $offwhite5: #e0e0e0; | |
| $offwhite6: #e3e2e2; |
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
| Atom Sync |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
NewerOlder