Skip to content

Instantly share code, notes, and snippets.

View JoshRiser's full-sized avatar

Josh Riser JoshRiser

  • Hopeware
  • Charleston, SC
View GitHub Profile
@JoshRiser
JoshRiser / grid-1436px.css
Last active December 21, 2015 03:58
Responsive 1436px Grid
.container { width: 1436px; margin: auto; position: relative; }
.row > [class*="grid"]:last-child, .last { margin-right: 0; }
.grid1, .grid2, .grid3, .grid4, .grid5, .grid6, .grid7, .grid8, .grid9, .grid10, .grid11, .grid12 { float: left; margin-right: 40px; }
.grid1 { width: 83px; }
.grid2 { width: 206px; }
.grid3 { width: 329px; }
.grid4 { width: 452px; }
.grid5 { width: 575px; }
.grid6 { width: 698px; }
.grid7 { width: 821px; }
@JoshRiser
JoshRiser / wp-media-search.php
Last active January 14, 2016 16:12
Include uploaded media in the link search from TinyMCE
function fo_alter_link_query_arg($query){
$query['post_status'] = array('inherit', 'publish');
return $query;
}
function fo_alter_link_query($results){
if(empty($results))
return $results;
foreach ($results as $id => $p) {
$post = get_post($p['ID']);
@JoshRiser
JoshRiser / wp-featured-image-url.php
Created January 14, 2016 16:11
Cut to the chase - Get the URL of the featured image, and optionally specify size
@JoshRiser
JoshRiser / wp-get-slug.php
Created January 14, 2016 16:13
Get the slug of any post or page easily
function the_slug($post = 0) {
echo apply_filters('the_slug', get_the_slug($post));
}
function get_the_slug($post = 0) {
$post = get_post($post);
return apply_filters('get_the_slug', $post->post_name);
}