Skip to content

Instantly share code, notes, and snippets.

@spigists
spigists / new_gist_file.css
Created Oct 2, 2013
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
View new_gist_file.css
.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 Aug 7, 2013
Fix the search box on WordPress 3.6 sites using older versions of Roots (non BS 3 versions)
View header
<!--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 Jul 9, 2013
Fix Google Maps controls and info card issues that are caused by Twitter Bootstrap
View new_gist_file
img[src*="gstatic.com/"], img[src*="googleapis.com/"] {
max-width: none;
}
@spigists
spigists / new_gist_file
Created Jun 11, 2013
WordPress Plugins
View new_gist_file
http://mansjonasson.se/wordpress-plugins/enable-media-replace/
@spigists
spigists / custom.php
Created Jun 11, 2013
Changes the Read More text when using the_excerpt
View custom.php
/**
* 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 Jun 10, 2013
Use Google's CDN version of jQuery
View functions.php
/**
* 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 Jun 10, 2013
Use Google's version of HTML5 shim but only for old versions of IE
View functions.php
/**
* 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 Jun 10, 2013
Remove useless dashboard widgets from the start screen
View functions.php
/**
* 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 Jun 10, 2013
Change the default from and from name on WordPress emails
View functions.php
/**
* 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 Jun 10, 2013
Remove the built in theme/plugin editor from the dashboard
View functions.php
/**
* Remove the built in theme/plugin editor from the dashboard
*/
define('DISALLOW_FILE_EDIT', true);
You can’t perform that action at this time.