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 / | |
| # require www and https | |
| # comment out the first two if you do not need www | |
| # comment out all lines for local dev | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] |
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
| /*CSS*/ | |
| @media only screen and (max-width: 500px) { | |
| table, tr, td { | |
| display: block; /* table-cell -> block */ | |
| width: 100%; | |
| } | |
| .main-col { display: table-header-group; } | |
| .sub-col { display: table-footer-group; } | |
| } |
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
| <!--HTML--> | |
| <table> <!--“Desktop” width — 600px - 300*2--> | |
| <tr> | |
| <td class=”sub-col” width=”300”>...</td> | |
| <td class=”main-col” width=”300”>...</td> | |
| </tr> | |
| </table> |
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('post_type_link','custom_post_type_link',10,3); | |
| function custom_post_type_link($permalink, $post, $leavename) { | |
| $url_components = parse_url($permalink); | |
| $post_path = $url_components['path']; | |
| $path_base = explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) ); | |
| $post_name = ltrim( end( $path_base ), '/' ); | |
| if(!empty($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
| /*-----------------------------------------------------------------------------------*/ | |
| // REQUIRE SIZES FOR ASSETS ON UPLOAD | |
| /*-----------------------------------------------------------------------------------*/ | |
| add_filter('wp_handle_upload_prefilter','riester_handle_upload_prefilter'); | |
| function riester_handle_upload_prefilter($file) { | |
| // see if we are trying to upload on a custom post type | |
| if(get_post_type($_REQUEST['post_id']) == 'my_custom_post_type_name') { | |
| // leave. this is wordpress stuff |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |