Getting started:
Related tutorials:
- MySQL-CLI: https://www.youtube.com/playlist?list=PLfdtiltiRHWEw4-kRrh1ZZy_3OcQxTn7P
- Analyzing Business Metrics: https://www.codecademy.com/learn/sql-analyzing-business-metrics
| // function for critical path css | |
| function critical_css() { | |
| // css | |
| $crit_sheet = get_template_directory_uri() . '/critical.css'; | |
| $critical_path = file_get_contents($crit_sheet); | |
| // loadCSS | |
| $js_sheet = get_template_directory_uri() . '/js/loadCSS.js'; | |
| $loadCSS_path = file_get_contents($js_sheet); |
| <?php | |
| global $wpdb; | |
| // @ prefix used to suppress errors, but you should do your own | |
| // error checking by checking return values from each mysql_query() | |
| // Start Transaction | |
| @mysql_query("BEGIN", $wpdb->dbh); | |
| // Do some expensive/related queries here |
Getting started:
Related tutorials:
| <?php | |
| //Add Open/Closed info to location listing columns | |
| add_filter('manage_edit-location_columns', 'schc_location_hours_columns_head'); | |
| function schc_location_hours_columns_head($defaults){ | |
| $defaults['openclosed'] = 'Open/Closed'; | |
| return $defaults; | |
| } | |
| add_action('manage_location_posts_custom_column', 'schc_location_hours_columns_content', 15, 3); | |
| function schc_location_hours_columns_content($column_name, $id){ | |
| if ( $column_name == 'openclosed' ){ |
| #!/bin/bash -e | |
| wpuser='exampleuser' | |
| clear | |
| echo "=================================================================" | |
| echo "Awesome WordPress Installer!!" | |
| echo "=================================================================" |
⇐ back to the gist-blog at jrw.fi
Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.
I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.
This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso
| // It is important to declare your variables. | |
| (function() { | |
| var foo = 'Hello, world!'; | |
| print(foo); //=> Hello, world! | |
| })(); | |
| // Because if you don't, the become global variables. | |
| (function() { |
| /* | |
| * Customize the Featured Image metabox w/ info-text | |
| * | |
| */ | |
| function mim_remove_featuredimage_metabox() { | |
| remove_meta_box( 'postimagediv', 'inspire', 'side' ); | |
| } | |
| add_action( 'admin_head', 'mim_remove_featuredimage_metabox' ); | |
| function mim_custom_featuredimage_metabox( $post ) { |
| function reading_time() { | |
| $content = get_post_field( 'post_content', $post->ID ); | |
| $word_count = str_word_count( strip_tags( $content ) ); | |
| $readingtime = ceil($word_count / 200); | |
| if ($readingtime == 1) { | |
| $timer = " minute"; | |
| } else { | |
| $timer = " minutes"; | |
| } |