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 | |
| // place in functions.php | |
| add_filter( 'gform_currencies', 'update_currency' ); | |
| function update_currency( $currencies ) { | |
| $currencies['EUR'] = array( | |
| 'name' => __( 'Euro', 'gravityforms' ), | |
| 'symbol_left' => '€', | |
| 'symbol_right' => '', | |
| 'symbol_padding' => ' ', |
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 | |
| /* | |
| * Display 4 items from Member post type. | |
| * Posts are organized by menu order. | |
| * Use https://wordpress.org/plugins/simple-page-ordering/ or similar to easily sort items. | |
| */ | |
| $the_query = new WP_Query( array( | |
| 'post_type' => 'member', | |
| 'posts_per_page' => 4, |
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
| // First enqueue this funciton in functions.php | |
| `wp_enqueue_script( 'scrollto', '//cdn.jsdelivr.net/jquery.scrollto/2.1.2/jquery.scrollTo.min.js', array( 'jquery' ), '20161205', true );` | |
| // Bind to the click of all links with a #hash in the href | |
| if ( $.isFunction($.fn.scrollTo) ) { | |
| $('a[href^="#"]').click(function(e) { | |
| e.preventDefault(); | |
| // Scroll the window, stop any previous animation, stop on user manual scroll | |
| // Check https://github.com/flesler/jquery.scrollTo for more customizability | |
| $(window).stop(true).scrollTo(this.hash, {duration:1000, interrupt: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
| <?php | |
| //Add a stylesheet after default style.css | |
| wp_enqueue_style( 'my-css', get_template_directory_uri() . 'my-css.css', array('themename-style')); | |
| //WooCommerce - Sort products by SKU | |
| add_filter('woocommerce_get_catalog_ordering_args', 'custom_woocommerce_catalog_orderby'); | |
| function custom_woocommerce_catalog_orderby( $args ) { | |
| $args['meta_key'] = '_sku'; | |
| $args['orderby'] = 'meta_value'; | |
| $args['order'] = 'asc'; |
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 | |
| /* | |
| * Issue: the validation was preventing me from using non-standard domains when developing on localhost. | |
| * Solution: disabled the URL verification, so I can use relative URLs and non-standard domains. | |
| * | |
| */ | |
| /* | |
| * Disable admin URL validation for Files, Images, Audio, and Video. |
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
| # BEGIN WordPress | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteCond %{HTTPS} !=on | |
| RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L] | |
| RewriteRule ^index\.php$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f |
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
| wget http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.epub | |
| wget http://www.oreilly.com/programming/free/files/object-oriented-vs-functional-programming.epub | |
| wget http://www.oreilly.com/programming/free/files/java-the-legend.epub | |
| wget http://www.oreilly.com/programming/free/files/introducing-java-8.epub | |
| wget http://www.oreilly.com/programming/free/files/a-whirlwind-tour-of-python.epub | |
| wget http://www.oreilly.com/programming/free/files/20-python-libraries-you-arent-using-but-should.epub | |
| wget http://www.oreilly.com/programming/free/files/hadoop-with-python.epub | |
| wget http://www.oreilly.com/programming/free/files/how-to-make-mistakes-in-python.epub | |
| wget http://www.oreilly.com/programming/free/files/functional-programming-python.epub | |
| wget http://www.oreilly.com/programming/free/files/python-in-education.epub |
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 | |
| /* | |
| * Append Bootstrap tabs to the post's content using ACF Pro repeater field. | |
| * | |
| * Prequisites: | |
| * - ACF PRO plugin | |
| * - Repeater field `tabs` containing `tab_title` (text) and `tab_content` (WYSIWYG) fields. | |
| * - Bootstrap 4.0 with util.js and tab.js loaded (or bootrap.js) | |
| */ |