Skip to content

Instantly share code, notes, and snippets.

/*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; }
}
<!--HTML-->
<table> <!--“Desktop” width — 600px - 300*2-->
<tr>
<td class=”sub-col” width=”300”>...</td>
<td class=”main-col” width=”300”>...</td>
</tr>
</table>
@dnnsldr
dnnsldr / remove_slug_from_custom_post_type.php
Last active October 13, 2016 16:53 — forked from stefanbc/remove_slug.php
These functions remove the slug from a permalink for a custom post type. These should be placed in functions.php in your theme and the permalink structure should be /%postname%/
<?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)) {
@dnnsldr
dnnsldr / 0_reuse_code.js
Created June 25, 2016 00:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console