Skip to content

Instantly share code, notes, and snippets.

@zeropointdevelopment
zeropointdevelopment / functions.php
Created Mar 3, 2014
Shortcode to output social media buttons.
View functions.php
// Social Media Buttons
function lc_social_media_buttons( $atts, $content = null ){
// get attributes
extract(shortcode_atts(array(
'align' => 'left',
'twitter' => '',
'facebook' => '',
'googleplus' => '',
'linkedin' => '',
'pinterest' => '',
@zeropointdevelopment
zeropointdevelopment / conditional-ie.html
Last active Jan 3, 2016
[WordPress] Code for article: CSS Hacks for IE targeting only IE8, IE7 and IE6 - http://www.limecanvas.com/css-hacks-for-ie-targeting-only-ie8-ie7-and-ie6/
View conditional-ie.html
<!--[if lte IE 9]>
Your IE8 and below HTML code here.
Perhaps importing a specific style sheet.
<![endif]-->
View gist:8394738
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
/* IE10+ specific styles go here */
}
@zeropointdevelopment
zeropointdevelopment / README.md
Last active Jan 1, 2016
[WordPress] Code from our blog post WordPress .htaccess on Zeus Server - http://www.limecanvas.com/wordpress-htaccess-on-zeus-server/
View README.md

rewrite.script is the .htaccess alternative for Zeus Servers

@zeropointdevelopment
zeropointdevelopment / code-snippet-1.php
Created Dec 27, 2013
[WordPress] Code from our blog post Stopping WordPress Media Attachment Comment Spamming - http://www.limecanvas.com/stopping-wordpress-media-attachment-comment-spamming/
View code-snippet-1.php
/** Stop comments being used on Media Files **/
add_filter( 'comments_open', 'stopMediaComments', 10, 2 );
function stopMediaComments( $open, $post_id ) {
$post = get_post( $post_id );
if ( 'attachment' == $post->post_type )
$open = false;
return $open;
}
/** This is used to get around non-native WordPress plugins **/
@zeropointdevelopment
zeropointdevelopment / code-snippet-1.php
Created Dec 27, 2013
[WordPress] Code from our blog post How to Disable Theme Switching - http://www.limecanvas.com/how-to-disable-theme-switching/
View code-snippet-1.php
add_action('admin_init', 'lc_disable_theme');
function lc_disable_theme() {
global $menuitem, $userdata;
get_currentuserinfo();
if ($userdata->ID != 1) {
unset($menuitem['themes.php'][5]);
unset($menuitem['themes.php'][15]);
}
}
@zeropointdevelopment
zeropointdevelopment / code-snippet-1.txt
Created Dec 27, 2013
[WordPress] Code from our blog post Securing the WordPress Uploads Folder - http://www.limecanvas.com/securing-the-wordpress-uploads-folder/
View code-snippet-1.txt
<Files ~ ".*..*">
Order Allow,Deny
Deny from all
</Files>
<FilesMatch ".(jpg|jpeg|jpe|gif|png|tif|tiff)$">
Order Deny,Allow
Allow from all
</FilesMatch>
@zeropointdevelopment
zeropointdevelopment / code-snippet-1.php
Created Dec 27, 2013
[WordPress] Code from our blog post How to Backup your WordPress Website - http://www.limecanvas.com/how-to-backup-your-wordpress-website/
View code-snippet-1.php
/* Enable alternative WP Cron */
define('ALTERNATE_WP_CRON', true);
@zeropointdevelopment
zeropointdevelopment / code-snippet-1.html
Last active Jan 1, 2016
[WordPress] Code from our blog page Developing A Facebook Tabs iFrame Application - http://www.limecanvas.com/developing-a-facebook-tabs-iframe-application/
View code-snippet-1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My New App</title>
<link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
<div id="main">
@zeropointdevelopment
zeropointdevelopment / code-snippet-1.txt
Created Dec 27, 2013
[WordPress] Code from our blog page Stop Image Hotlinking - http://www.limecanvas.com/stop-image-hotlinking/
View code-snippet-1.txt
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/hotlinking-thief.jpg [L]
You can’t perform that action at this time.