Skip to content

Instantly share code, notes, and snippets.

@kraftbj
kraftbj / functions.php
Last active September 15, 2015 16:08
Force Jetpack's Content Width (for Tiled Galleries and other purposes when the theme's content width isn't set or being passed)
function bk_set_jetpack_width() {
$content_width = 750;
return $content_width;
}
add_filter('jetpack_content_width', 'bk_set_jetpack_width');
@mpeshev
mpeshev / theme-review-porto.md
Last active December 27, 2015 22:18
Theme Review Porto plan
@anthonyshort
anthonyshort / _media-queries.scss
Created March 13, 2012 10:37
Media Queries in Sass
// Media Queries in Sass 3.2
//
// These mixins make media queries a breeze with Sass.
// The media queries from mobile up until desktop all
// trigger at different points along the way
//
// And important point to remember is that and width
// over the portrait width is considered to be part of the
// landscape width. This allows us to capture widths of devices
// that might not fit the dimensions exactly. This means the break
@brajeshwar
brajeshwar / wordpress-post-thumbnail-or-first-image-or-default.php
Created September 9, 2011 10:23
Wordpress - Get the Image from Post Thumbnail or the First Image of a post or else use a default Image.
/*
* Display Image from the_post_thumbnail or the first image of a post else display a default Image
* Chose the size from "thumbnail", "medium", "large", "full" or your own defined size using filters.
* USAGE: <?php echo my_image_display(); ?>
*/
function my_image_display($size = 'full') {
if (has_post_thumbnail()) {
$image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id, $size);