Skip to content

Instantly share code, notes, and snippets.

@spigists
spigists / new_gist_file.css
Created October 2, 2013 16:16
Bootstrap 3 styles for Gravity Forms, make sure that in Forms > Settings you have Output CSS set to No and Output HTML5 set to Yes
.gform_wrapper ul {
padding-left: 0;
list-style: none; }
.gform_wrapper li {
margin-bottom: 15px; }
.gform_wrapper form {
margin-bottom: 0; }
@spigists
spigists / header
Created August 7, 2013 18:08
Fix the search box on WordPress 3.6 sites using older versions of Roots (non BS 3 versions)
<!--Start Search Form -->
<div class="span3">
<div id="search" class="input-append">
<form role="search" method="get" id="searchform" action="http://##SITE-URL-HERE##" _lpchecked="1">
<label class="hide" for="s">Search for:</label> <input type="text" value="" name="s" id="s" class="span2" placeholder="Search...">
<button type="submit" id="searchsubmit" value="Search" class="btn">Search</button></form>
</div>
</div>
<!--End Search Form -->
@spigists
spigists / new_gist_file
Created July 9, 2013 17:58
Fix Google Maps controls and info card issues that are caused by Twitter Bootstrap
img[src*="gstatic.com/"], img[src*="googleapis.com/"] {
max-width: none;
}
@spigists
spigists / new_gist_file
Created June 11, 2013 22:11
WordPress Plugins
http://mansjonasson.se/wordpress-plugins/enable-media-replace/
@spigists
spigists / custom.php
Created June 11, 2013 22:00
Changes the Read More text when using the_excerpt
/**
* Changes the Read More text when using the_excerpt
*/
function new_excerpt_more($more) {
global $post;
return '<a class="moretag" href="'. get_permalink($post->ID) . '">Read the full article...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
@spigists
spigists / functions.php
Created June 10, 2013 21:50
Use Google's CDN version of jQuery
/**
* Custom functions
*/
function jquery_enqueue() {
wp_deregister_script('jquery');
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js", false, null);
wp_enqueue_script('jquery');
}
if (!is_admin()) add_action("wp_enqueue_scripts", "jquery_enqueue", 11);
@spigists
spigists / functions.php
Created June 10, 2013 21:49
Use Google's version of HTML5 shim but only for old versions of IE
/**
* Use Google's version of HTML5 shim but only for old versions of IE
*/
function iehtml5_shim () {
global $is_IE;
if ($is_IE)
echo '<!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->';
}
add_action('wp_head', 'iehtml5_shim');
@spigists
spigists / functions.php
Created June 10, 2013 21:42
Remove useless dashboard widgets from the start screen
/**
* Remove useless dashboard widgets
*/
function remove_dashboard_widgets(){
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
@spigists
spigists / functions.php
Created June 10, 2013 21:41
Change the default from and from name on WordPress emails
/**
* Change the default from and from name on WordPress emails
*/
add_filter('wp_mail_from', 'new_mail_from');
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_fom($old) {
return 'noreply@go-spi.com';
}
function new_mail_from_name($old) {
@spigists
spigists / functions.php
Created June 10, 2013 21:40
Remove the built in theme/plugin editor from the dashboard
/**
* Remove the built in theme/plugin editor from the dashboard
*/
define('DISALLOW_FILE_EDIT', true);