Skip to content

Instantly share code, notes, and snippets.

View michaelmusgrove's full-sized avatar

Michael Musgrove michaelmusgrove

View GitHub Profile
@michaelmusgrove
michaelmusgrove / color-pallette.scss
Created August 12, 2014 07:33
SCSS template for website color pallette.
$primary: #608d4e;
$secondary: #87594d;
$highlight: #abc147;
$accent: #26ada1;
$background: #ced9bc;
@michaelmusgrove
michaelmusgrove / full-screen-video-shortcode.php
Created August 12, 2014 03:39
Make front page full screen video. source: http://wpsites.net/web-design/how-to-add-full-screen-video-from-your-wordpress-media-library/ The shortcode used (example): [video src="http://www.example.dev/wp-content/uploads/2014/08/demo.mp4" width="1400" height="400" progress="false" autoplay="true" ]
add_filter('widget_text', 'do_shortcode');
add_action('wp_head', 'wpsites_fill_width_video' );
function wpsites_fill_width_video() {
if( is_front_page() ) {
echo do_shortcode('[video src="http://www.example.dev/wp-content/uploads/2014/08/demo.mp4" width="1400" height="400" progress="false" autoplay="true"]');
}
}
@michaelmusgrove
michaelmusgrove / cta-widget.css
Created August 11, 2014 09:41
Add a CTA widget to any StudioPress theme
/* Your Call To Action Widget
--------------------------------------------- */
.call-to-action a.button {
background-color: #64C9EA;
display: inline-block;
margin-top: -30px;
margin-top: -3rem;
text-align: center;
color: #fff;
}
@michaelmusgrove
michaelmusgrove / wordpress-debris-removal.php
Created August 9, 2014 03:00
Place the following code in your functions.php file of your WordPress theme to remove some useless things from the head of your site. There are a lot of things that WordPress adds to the head of your site. These can all be removed using the remove_action function that WordPress provides in your functions.php file.
// functions.php
// =========================================================================
// REMOVE JUNK FROM HEAD
// =========================================================================
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
remove_action('wp_head', 'wp_generator'); // remove wordpress version
remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service)
remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
@michaelmusgrove
michaelmusgrove / bg-line-header.css
Created August 6, 2014 01:15
This snippet will allow you to put a background line on either side of the header text:
h2 {
text-align: center;
display: table;
width: 100%;
}
h2 > span, h2:before, h2:after {
display: table-cell;
}
h2:before, h2:after {
background: url(http://dummyimage.com/2x1/f0f/fff&text=+) repeat-x center;
@michaelmusgrove
michaelmusgrove / keybase.md
Created August 4, 2014 21:36
Verfying keybase.io

Keybase proof

I hereby claim:

  • I am MichaelMusgrove on github.
  • I am mbm (https://keybase.io/mbm) on keybase.
  • I have a public key whose fingerprint is 4A37 8D7D 9C8D D622 F7B7 EA4D 5C4B 519F 759B C8E2

To claim this, I am signing this object:

@michaelmusgrove
michaelmusgrove / google-trends-embed.php
Created June 15, 2014 05:55
Shortcode to embed google trends graph in posts and pages. Add to functions.php.
@michaelmusgrove
michaelmusgrove / sample-wp-404.php
Created June 13, 2014 07:16
Sample 404 page for WP based on the 2013 theme
<?php
/**
* The template for displaying 404 pages (Not Found)
*
*/
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
@michaelmusgrove
michaelmusgrove / 0_reuse_code.js
Created June 6, 2014 10:03
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@michaelmusgrove
michaelmusgrove / fallback-adjust.css
Created December 12, 2013 07:49
Adjusting font sizes for fallback fonts
.adjust {
font-size-adjust: auto;
}