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 | |
| /** | |
| * Read ACF fields from JSON | |
| */ | |
| function PREFIX_acf_register_json_fields() { | |
| if (function_exists("acf_add_local_field_group")) { | |
| $acf_json_data = locate_template("path/to/advanced-custom-fields.json"); | |
| $custom_fields = $acf_json_data ? json_decode(file_get_contents($acf_json_data), true) : array(); | |
| foreach ($custom_fields as $custom_field) { |
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
| /** | |
| * Register hero block | |
| */ | |
| add_action('acf/init', 'hero'); | |
| function hero() { | |
| // check function exists | |
| if( function_exists('acf_register_block') ) { | |
| // register a hero block |
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
| { | |
| "scripts" : { | |
| "tests" : "composer fixes && composer sniffs && composer lints && phpunit --coverage-clover coverage/clover.xml", | |
| "sniffs" : "phpcs --standard=PSR2 src/ && phpcs --standard=PSR2 tests/", | |
| "fixes" : "php-cs-fixer fix src/ && php-cs-fixer fix tests/", | |
| "lints" : "parallel-lint ./src --blame --exclude vendor && parallel-lint ./tests --blame --exclude vendor" | |
| } | |
| } |
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 | |
| function get_youtube_video_ID($youtube_video_url) { | |
| /** | |
| * Pattern matches | |
| * http://youtu.be/ID | |
| * http://www.youtube.com/embed/ID | |
| * http://www.youtube.com/watch?v=ID | |
| * http://www.youtube.com/?v=ID | |
| * http://www.youtube.com/v/ID | |
| * http://www.youtube.com/e/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
| <?php // Do not include this if already open! | |
| /** | |
| * Code goes in theme functions.php. | |
| */ | |
| add_filter( 'woocommerce_defer_transactional_emails', '__return_false' ); |
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 responsive_image_background($image_field_name) { | |
| $imageobject = get_field($image_field_name); | |
| echo '<img class="fullscreen__image-background" src="' . $imageobject['sizes']['superhero'] . '" srcset="' . $imageobject['sizes']['superhero'] .' '. $imageobject['sizes']['superhero-width'] .'w, ' . $imageobject['sizes']['hero'] .' '. $imageobject['sizes']['hero-width'] .'w, '. $imageobject['sizes']['large'] .' '. $imageobject['sizes']['large-width'] .'w">'; | |
| } |
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 | |
| //check if form was sent | |
| if($_POST){ | |
| $to = 'some@email.com'; | |
| $subject = 'Testing HoneyPot'; | |
| $header = "From: $name <$name>"; | |
| $name = $_POST['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
| /* | |
| This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects. | |
| It will generate several classes such as: | |
| .m-r-10 which gives margin-right 10 pixels. | |
| .m-r-15 gives MARGIN to the RIGHT 15 pixels. | |
| .m-t-15 gives MARGIN to the TOP 15 pixels and so on. | |
| .p-b-5 gives PADDING to the BOTTOM of 5 pixels | |
| .p-l-40 gives PADDING to the LEFT of 40 pixels |
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
| sass/ | |
| | | |
| |– base/ | |
| | |– _reset.scss # Reset/normalize | |
| | |– _typography.scss # Typography rules | |
| | ... # Etc… | |
| | | |
| |– components/ | |
| | |– _buttons.scss # Buttons | |
| | |– _carousel.scss # Carousel |
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
| // change to false if its not imported into bootstrap | |
| $use-bootstrap: false; | |
| // margin and padding values array | |
| $space-values : ( | |
| 5, | |
| 10, | |
| 15, | |
| 20, | |
| 30, |
NewerOlder