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 | |
| add_shortcode( 'spotify', 'getSpotify' ); | |
| function getSpotify(){ | |
| // Add 'YOUR_CLIENT_ID' and 'YOUR_CLIENT_SECRET' with your actual Spotify API credentials | |
| $client_id = ''; | |
| $client_secret = ''; | |
| $show_id = ''; | |
| $ch = curl_init(); |
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
| add_action( 'acf/save_post', 'fox_sync_on_product_save', 99); | |
| function fox_sync_on_product_save( $product_id ) { | |
| $product = wc_get_product( $product_id ); | |
| wp_set_object_terms($product_id, 'variable', 'product_type'); | |
| $event_dates = get_field('event_dates', $product_id); | |
| if (is_array($event_dates)){ | |
| create_product_variation( $product_id, $event_dates ); | |
| } |
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
| var gulp = require('gulp'); | |
| var sass = require('gulp-sass'); | |
| var cleanCSS = require('gulp-clean-css'); | |
| var minify = require('gulp-minify'); | |
| var concat = require('gulp-concat'); | |
| gulp.task('styles', function() { | |
| gulp.src('wp-content/themes/themename/assets/sass/style.scss') | |
| .pipe(sass().on('error', sass.logError)) | |
| .pipe(cleanCSS()) |
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
| /* SIMPLE CSS */ | |
| header nav { color:#000; background-color:#fff; } | |
| header nav li { color: #000; font-weight:500; } | |
| header nav li a { padding:5px; border-right:1px solid #f9f9f9; } | |
| header nav li a:last-child { border-right:0px; } | |
| /* SASS - the same code, uncompiled (as a programmer would write it) */ | |
| header nav { color:#000; background-color:#fff; |
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 excerpt_function($ID, $searchTerms) { | |
| global $wpdb; | |
| $thisPost = get_post_meta($ID); | |
| foreach ($thisPost as $key => $value) { | |
| if ( false !== stripos($value[0], $searchTerms) ) { | |
| $found = substr(strip_tags($value[0]), 0, 150); | |
| echo $found . ' ...'; | |
| } | |
| } | |
| } |