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 pesky youtube links from post excerpts */ | |
| add_filter('wpv_filter_post_excerpt', 'xmit_remove_youtubelinks'); | |
| function xmit_remove_youtubelinks($excerpt){ | |
| return $excerpt = preg_replace('~(?:http|https|)(?::\/\/|)(?:www.|)(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/ytscreeningroom\?v=|\/feeds\/api\/videos\/|\/user\S*[^\w\-\s]|\S*[^\w\-\s]))([\w\-]{11})[a-z0-9;:@?&%=+\/\$_.-]*~i', '', $excerpt); | |
| } |
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
| // String utils | |
| // | |
| // resources: | |
| // -- mout, https://github.com/mout/mout/tree/master/src/string | |
| /** | |
| * "Safer" String.toLowerCase() | |
| */ | |
| function lowerCase(str){ | |
| return str.toLowerCase(); |
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 | |
| // Sort a CPT by Title – just change the CPT slug at is_post_type_archive | |
| add_filter( 'parse_query', 'sorting_archives' ); | |
| function sorting_archives( $wp_query ) { | |
| if (is_post_type_archive( 'gg_engagement' ) || is_tax()) { | |
| $wp_query->set( 'orderby', 'title' ); | |
| $wp_query->set( 'order', 'ASC' ); | |
| } | |
| return $wp_query; |
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
| <input type="email" id="validateEmailAddress" class="form-control" autocomplete="off" onpaste="return false;" required="" placeholder="Re-enter your email address here..." data-com.agilebits.onepassword.user-edited="yes"> |
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 add_tracking_to_footer() { | |
| ?> | |
| <script type="text/javascript"> _linkedin_partner_id = "1061154"; window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; window._linkedin_data_partner_ids.push(_linkedin_partner_id); </script><script type="text/javascript"> (function(){var s = document.getElementsByTagName("script")[0]; var b = document.createElement("script"); b.type = "text/javascript";b.async = true; b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; s.parentNode.insertBefore(b, s);})(); </script> <noscript> <img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=1061154&fmt=gif" /> </noscript> | |
| <?php | |
| } | |
| add_action ('wp_footer', 'add_tracking_info_to_footer', 99); |
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
| In Woocommerce -> Settings -> Shipping, set up a Shipping Zone for Standard Shipping. | |
| Add Shipping methods, in this case three: Standard Shipping ($7), Discounted Shipping ($5), and Free Shipping ($0). | |
| Add the PHP to functions.php. To find out the id # of the rates, inspect the shipping methods in your browser; | |
| the data-id of the table row for each is what has to go into the 'flat_rate:x' 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
| <?php | |
| /** | |
| * | |
| * This removes the ability to add the FULL image size into a post, it does not alter or delete the image | |
| * Add whataever extra image sizes to the insert dropdown in WordPress you create via add_image_size | |
| * | |
| * For now we have to do it this way to make the labels translatable, see trac ref below. | |
| * | |
| * If your theme has $content_width GLOBAL make sure and remove it |
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 | |
| // first, create the function to put your tracking code into | |
| function add_tracking_info_to_head() { | |
| // paste your tracking code between the ?> and <?php below – in this case it's for Google Analytics | |
| ?> | |
| <!-- Global site tag (gtag.js) - Google Analytics --> |
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_filter( 'fl_builder_override_lightbox', '__return_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
| add_action( 'wp_enqueue_scripts', function() { | |
| wp_enqueue_style( 'font-awesome-5' ); | |
| } ); |