Skip to content

Instantly share code, notes, and snippets.

View farnscosnippet's full-sized avatar

FarnsCo Snippets farnscosnippet

View GitHub Profile
@farnscosnippet
farnscosnippet / reset.sass
Last active June 8, 2016 17:29 — forked from trey/reset.sass
SASS: Eric Meyer's Reset
// BEGIN _reset.scss
/* http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
body { line-height: 1; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
@farnscosnippet
farnscosnippet / gist:5808184
Last active June 8, 2016 17:29
WORDPRESS: Jessica Hische's Post Reset
// Adjust the WYSISYG Editor
function myformatTinyMCE($in)
{
$in['remove_linebreaks']=false;
$in['gecko_spellcheck']=false;
$in['keep_styles']=false;
$in['accessibility_focus']=true;
$in['tabfocus_elements']='major-publishing-actions';
$in['media_strict']=false;
$in['paste_remove_styles']=false;
@farnscosnippet
farnscosnippet / gist:6067717
Last active June 8, 2016 17:29
CSS: Input Fields at 100%
.form-input input, .form-input textarea { display: block; width: 100%; padding: 0; border-width: 0; }
.form-input { border: 0; padding: 1vw; margin: 1vw; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
.form-button { margin: 1vw; }
.form-input input { }
.form-input textarea { }
.form-box button { display: block; border: 0; padding: 1vw; width: 100%; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }
@farnscosnippet
farnscosnippet / gist:7328120
Last active June 8, 2016 17:29
WORDPRESS: Use Tags as Meta Tags
<meta name="keywords" content="<?php if(is_single()) {
$metatags = get_the_tags($post->ID);
foreach ($metatags as $tagpost) {
$mymetatag = apply_filters('the_tags',$tagpost->name);
$keyword = utf8_decode($mymetatag); // Your filters...
echo $keyword.",";
}
}
?>" />
@farnscosnippet
farnscosnippet / WORDPRESS - Register Custom Post Type.php
Last active January 8, 2018 21:16 — forked from farnsco/gist:5125500
WORDPRESS - Register Custom Post Type
// Registering Custom Post Type for Replace_names
function custom_type_Replace_names() {
$labels = array(
'name' => 'Replace_names',
'singular_name' => 'Replace_name',
'add_new' => 'Add Replace_name',
'add_new_item' => 'Add New',
'edit_item' => 'Edit Replace_name',
'new_item' => 'New Replace_name',
'all_items' => 'All Replace_names',
@farnscosnippet
farnscosnippet / JQUERY - Switch Content.js
Last active January 8, 2018 21:16
JQUERY - Switch Content
$(function(){
function contentSwitcher(settings){
var settings = {
contentClass : '.content',
navigationId : '#navigation'
};
//Hide all of the content except the first one on the nav
$(settings.contentClass).not(':first').hide();
$(settings.navigationId).find('li:first').addClass('active');
@farnscosnippet
farnscosnippet / WORDPRESS - Remove Width and Height from Inserted Images.js
Last active January 8, 2018 21:15
JQUERY - Horizontal and Vertical Centering
$(window).resize(function(){
$('.className').css({
position:'absolute',
left: ($(window).width() - $('.className').outerWidth())/2,
top: ($(window).height() - $('.className').outerHeight())/2
});
});
@farnscosnippet
farnscosnippet / WORDPRESS - Remove Width and Height from Inserted Images.php
Last active January 8, 2018 21:15
WORDPRESS - Remove Width and Height from Inserted Images
add_filter( 'post_thumbnail_html', 'remove_width_attribute', 10 );
add_filter( 'image_send_to_editor', 'remove_width_attribute', 10 );
function remove_width_attribute( $html ) {
$html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
return $html;
}
@farnscosnippet
farnscosnippet / WORDPRESS - Edit Wordpress's Built-in Gallery.php
Last active January 8, 2018 21:13
WORDPRESS - Edit Wordpress's Built-in Gallery
@farnscosnippet
farnscosnippet / WORDPRESS - Add Excerpt Functionality to Pages.php
Last active January 8, 2018 21:13
WORDPRESS - Add Excerpt Functionality to Pages
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}