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
| // Adding a lazyloading option to all responsive images | |
| // Need to figure out the array for each 'srcset' | |
| function bcbs_preprocess_responsive_image(&$variables) { | |
| // kint($variables['sources'][0]['srcset']); | |
| // kint($variables['sources'][0]); | |
| $variables['sources'][0]['data-src'] = $variables['sources'][0]['srcset']; | |
| // $variables['sources'][0]['srcset'] == $variables['sources'][0]['data-srcset']; | |
| // unset($variables['sources'][0]['srcset']); |
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
| Getting this error during config import: | |
| `Unable to uninstall the <em class="placeholder">Minimal</em> profile since it is the install profile.` | |
| Try this: https://www.drupal.org/project/drupal/issues/2870028#comment-12042807 | |
| Set {profile name} equal to {module name} |
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
| # ensure that cache tags bubble up as expected. | |
| # this avoids the use of {{ content|without() }} | |
| {% set catch_cache=content|render %} | |
| # checking for values in templates | |
| # gettig value from muti-value field in node template | |
| {% if node.field_related_topics is not empty %} | |
| <h2>{{ 'Related Topics'|t }}</h2> | |
| {{ content.field_related_topics }} | |
| {% endif %} |
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($){ | |
| var posts = $('.row-actions .edit a').map(function(){ return $(this).attr('href'); }).get(); | |
| var save = function() { | |
| var url, win, timer; | |
| if (!(url = posts.pop())) { | |
| return; | |
| } | |
| win = open(url); | |
| win.onload = 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
| <?php | |
| /** | |
| * Console application, which adds textdomain argument | |
| * to all i18n function calls | |
| * | |
| * Adapted from: | |
| * http://develop.svn.wordpress.org/trunk/tools/i18n/add-textdomain.php | |
| * | |
| * Extended such that all text domains are replaced if found or added otherwise. | |
| * Also, double-quoted strings are replaced by single-quoted strings. |
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
| /** | |
| * Remove certain options from the WYSIWYG editor | |
| * @param [type] $arr Element descriptions that are allowed in the editor | |
| * @return [type] array The array of allowable tags for the editor | |
| */ | |
| function _remove_blockformats( $arr ) { | |
| $arr['block_formats'] = "Paragraph=p; Heading 2=h2; Heading 3=h3; Heading 4=h4; Heading 5=h5; Heading 6=h6; Preformatted=pre"; | |
| return $arr; | |
| } | |
| add_filter( 'tiny_mce_before_init', '_remove_blockformats' ); |
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
| // rt = Responsive Typography | |
| // @params = Each of the params are synced up with the breakpoints that are defined in the _config.scss file. Feel free to add/remove on per project basis. | |
| @mixin rt($default:null, $sm:null, $md:null, $lg:null, $xl:null) { | |
| @if $default == null { | |
| @error "You must provide at least one value."; | |
| } @else { | |
| font-size: $default; | |
| } | |
| @if $sm != null and $sm != '' { |
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
| /** | |
| * Slide in Search & Menu | |
| * Original concept http://codepen.io/svinkle/pen/vCfoK | |
| * @johncionci | |
| */ | |
| $(function() { | |
| var $page = $('#page'); | |
| var $closeSearch = $('.close-toggle-search'); | |
| var $closeMenu = $('.close-toggle-menu'); | |
| // since we have two menus we break into multiple functions |
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 | |
| /** | |
| * Theme Plugin Customizer uses the Core customizer screen to enable or disable | |
| * theme specific plugins. We first add the plugins to the $theme_plugins array() | |
| * from there we can conditionally include required files to enhance theme capabilities. | |
| */ | |
| class Theme_Plugin_Customizer { | |
| /** | |
| * This hooks into 'customize_register' (available as of WP 3.4) and allows |
NewerOlder