Skip to content

Instantly share code, notes, and snippets.

View stffndk's full-sized avatar

Steffen Jørgensen stffndk

View GitHub Profile
@stffndk
stffndk / Preferences.sublime-settings
Last active September 15, 2015 19:02
My Sublime Text 3 settings
{
"auto_complete": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme",
"font_size": 16,
"ignored_packages":
[
"CSS3",
"Vintage"
],
"installed_packages":
@stffndk
stffndk / bootstrap-breakpoints.less
Last active August 29, 2015 13:57
Bootstrap: Show breakpoint labels in the viewport
// For LESS
body:before{
background: #f0a;
color: #fff;
content: "@screen-phone (col-xs-xx)";
padding: 10px;
position: fixed;
bottom: 10px;
left: 10px;
z-index: @zindex-modal + 10;
@stffndk
stffndk / disable_feeds.php
Created February 26, 2014 01:45
Disable all the feeds in WordPress
<?php
// disable all feeds
function fb_disable_feed() {
wp_die(__('<h1>Feed not available, please visit our <a href="'.get_bloginfo('url').'">Home Page</a>!</h1>'));
}
add_action('do_feed', 'fb_disable_feed', 1);
add_action('do_feed_rdf', 'fb_disable_feed', 1);
add_action('do_feed_rss', 'fb_disable_feed', 1);
add_action('do_feed_rss2', 'fb_disable_feed', 1);
<?php
add_filter( 'jpeg_quality', 'custom_jpeg_quality' );
function custom_jpeg_quality() {
return 100; // Whatever quality you like, 0-100, 100 is better
}
@stffndk
stffndk / custom_editor_content.php
Last active December 22, 2015 05:59
WordPress "custom_editor_content.php"Making a website for someone who does not know HTML markup, or just want a simple template for content you can use "custom_editor_content".Only new posts created will have this markup as a baseInclude this file in your themes functions.php file
<?php
// Documentation
// http://wp.smashingmagazine.com/2011/10/14/advanced-layout-templates-in-wordpress-content-editor/
add_filter( 'default_content', 'custom_editor_content' );
function custom_editor_content( $content ) {
global $current_screen;
if ( $current_screen->post_type == 'name_of_post_type') { // eg. "page" or "post"
$content = '
<h3>Edit the editor template:</h3>