Skip to content

Instantly share code, notes, and snippets.

function add_membership_support() {
$labels = array(
'name' => _x( 'DTS Premium', 'post type general name', 'sage' ),
'singular_name' => _x( 'Premium Post', 'post type singular name', 'sage' ),
'menu_name' => _x( 'Premium Posts', 'admin menu', 'sage' ),
'name_admin_bar' => _x( 'Premium Post', 'add new on admin bar', 'sage' ),
'add_new' => _x( 'Add New', 'product', 'sage' ),
'add_new_item' => __( 'Add New Premium Post', 'sage' ),
'new_item' => __( 'New Premium Post', 'sage' ),
'edit_item' => __( 'Edit Premium Post', 'sage' ),
@thedotmack
thedotmack / Update remote repo
Created December 30, 2016 22:50 — forked from mandiwise/Update remote repo
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
@thedotmack
thedotmack / gist:44a1bca95cc933df84b4
Created July 13, 2015 14:07
Bootstrap 3 Typography Fix
/*
* BOOTSTRAP TYPOGRAPHY SPACING FIX
*/
h1, .h1,
h2, .h2,
h3, .h3 {
margin-bottom: @line-height-computed;
}
h4, .h4,
@thedotmack
thedotmack / gist:b092198d208e8257e563
Created August 28, 2014 15:39
Simple js / jquery tweet buttons
<script src="//platform.twitter.com/widgets.js"></script>
<script>
var tweet = {
url: "", // url to share
via: "", // omit @, twitter username
text: "", // tweet text
hashtags: "" // omit #, comma seperated "twitter,twitterapi"
}
var intent_url = 'https://twitter.com/intent/tweet?' + $.param(tweet);
$('a#tweet-button').attr('href', intent_url);
nav {
&.navbar {
&.navbar-default {
.navbar-header {
.navbar-toggle {
}
.navbar-brand {
}
@thedotmack
thedotmack / gist:9495495
Created March 11, 2014 21:30
Converts Retina Pixel Widths to Proper % Equivalent w/ Bootstrap 3.x
.width-percentage(@pixel-width, @parent-columns) { // full retina pixel width
width: (@pixel-width / 2) / ((@container-lg / @grid-columns) * @parent-columns) * 100%;
height: auto;
}
.inset-shadow {
position: relative;
overflow: hidden;
&:before {
content: "";
position: absolute;
top: 0;
left: -30px;
bottom: 0;
right: -30px;
$('iframe').each(function(){
src = $(this).attr('src').search('youtu');
console.log(src);
if (src > 0) {
$(this).before('<style>.embed-container { position: relative; padding-bottom: 60%; padding-top: 30px; height: 0; overflow: hidden; max-width: 100%; height: auto; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100% !important; height: 93% !important; }</style>').wrap('<div class="embed-container"></div>');
}
})
@thedotmack
thedotmack / gist:5863530
Created June 25, 2013 23:45
Facebook open graph tags
<!-- Facebook Open Graph tags -->
<meta property="og:title" content="Bandana Training" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://bandanatraining.alexnewman.netdna-cdn.com/wp-content/uploads/2012/04/bt-default.jpg" />
<meta property="og:url" content="http://www.bandanatraining.com" />
<meta property="og:description" content="I Give Good Shred" />
<meta property="og:site_name" content="Bandana Training" />
<meta property="og:locale" content="en_US" />
<meta property="fb:admins" content="2222856" />
@thedotmack
thedotmack / gist:5863529
Created June 25, 2013 23:45
Facebook open graph tags
<!-- Facebook Open Graph tags -->
<meta property="og:title" content="Bandana Training" />
<meta property="og:type" content="website" />
<meta property="og:image" content="http://bandanatraining.alexnewman.netdna-cdn.com/wp-content/uploads/2012/04/bt-default.jpg" />
<meta property="og:url" content="http://www.bandanatraining.com" />
<meta property="og:description" content="I Give Good Shred" />
<meta property="og:site_name" content="Bandana Training" />
<meta property="og:locale" content="en_US" />
<meta property="fb:admins" content="2222856" />