Skip to content

Instantly share code, notes, and snippets.

@klongdesigns
klongdesigns / social-media-scss.scss
Created May 17, 2015
Social Media Colors SCSS code
View social-media-scss.scss
/* SASS / Social Media Brand Colors */
$twitter: #00aced;
$facebook: #3b5998;
$googleplus: #dd4b39;
$pinterest: #cb2027;
$linkedin: #007bb6;
$youtube: #bb0000;
$vimeo: #aad450;
$tumblr: #32506d;
@klongdesigns
klongdesigns / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@klongdesigns
klongdesigns / cron-job
Created Sep 15, 2014
Cron Job for Wordpress posts setup
View cron-job
php -q /home/survivi/public_html/wp-cron.php
@klongdesigns
klongdesigns / ga-demographics
Created Sep 5, 2014
Google Analytics Demographic add lin
View ga-demographics
//for universal analytics
ga('require', 'displayfeatures');
@klongdesigns
klongdesigns / ga-event-tracking-analytics
Created Aug 28, 2014
Google Analytics event tracking code for WordPress
View ga-event-tracking-analytics
function sendToGA(pagename,section) {
ga('send', {
'hitType': 'event', // Required.
'eventCategory': 'footerLink', // Required.
'eventAction': 'click', // Required.
'eventLabel': 'Footer Link: ' + section,
'eventValue': 4,
'page':'/'+pagename,
});
}
@klongdesigns
klongdesigns / font-sizing rems.less
Last active Aug 29, 2015
Less file for setting font sizes in rem
View font-sizing rems.less
//mixin declaration
.font-size(@sizeValue) {
@remValue: @sizeValue;
@pxValue: @sizeValue;
font-size: ~"@{pxValue}px";
font-size: ~"@{remValue}rem";
}
//media queries set
View SQL Query to pull post title, name and cateogry
SELECT post.post_title, post.post_name, tt.name
FROM `wp_posts` AS post
INNER JOIN `wp_term_relationships` AS terms ON ( post.ID = terms.object_id )
INNER JOIN `wp_term_taxonomy` AS tax ON ( terms.term_taxonomy_id = tax.term_taxonomy_id )
INNER JOIN `wp_terms` AS tt ON ( tax.term_id = tt.term_id )
WHERE post.post_type = 'post'
View iFrame Buster
/* iFrame Buster */
<script language="javascript" type="text/javascript">
//if (window!= top) top.location.href = location.href;
(function(window) {
if (window.location !== window.top.location) {
window.top.location = window.location;
}
})(this);
</script>
View Password Protect Wordpress login
/* Password Protect Admin section */
ErrorDocument 401 "Unauthorized Access"
ErrorDocument 403 "Forbidden"
<FilesMatch "wp-login.php">
AuthName "Authorized Only"
AuthType Basic
AuthUserFile /home/username/.htpaswrdname
require valid-user
</FilesMatch>
View Default Robots.txt file for Wordpress
#### Robots.txt file to block others
User-agent: MJ12bot*
Disallow: /
User-agent: NinjaBot
Allow: /
User-agent: Mediapartners-Google*
Allow: /