Skip to content

Instantly share code, notes, and snippets.

View lynettechandler's full-sized avatar

lynettechandler

View GitHub Profile
@lynettechandler
lynettechandler / functions.php
Created July 25, 2013 20:24
Add your own URLs to WordPress admin bar
// Add your own links to admin toolbar
function tbm935_custom_toolbar($wp_admin_bar) {
$wp_admin_bar->add_menu( array(
'parent' => 'site-name',
'id' => 'calendar', // Replace this
'title' => 'Calendar', // Replace with a name
'href' => 'http://techbasedmarketing.com/wpengine/wp-admin/edit.php?page=cal' // Replace with your own URL
));
$wp_admin_bar->add_menu( array(
'parent' => 'site-name',
@lynettechandler
lynettechandler / closewp
Created September 10, 2013 16:14
Shut down access to all traffic and display temporary page except for IP's listed.
<Limit GET POST PUT>
Order Deny,Allow
Deny from all
Allow from 100.1.10.10
</Limit>
ErrorDocument 403 /Upgrade.html
<Files Upgrade.html>
Order Allow,Deny
Allow from all
</Files>
@lynettechandler
lynettechandler / stopuploadscripts
Created September 10, 2013 18:15
Prevent Scripts From Running In Folder
# prevent scripts from running
AddHandler cgi-script .php .pl .jsp .asp .sh .cgi
Options -ExecCGI
@lynettechandler
lynettechandler / wphtaccessdeny
Last active December 22, 2015 18:29
Secure wp files
# secure htaccess file
<Files .htaccess>
order allow,deny
deny from all
</Files>
# secure other files
<FilesMatch ^((wp-config|wp-load|wp-settings)\.php$)$>
order allow,deny
deny from all
@lynettechandler
lynettechandler / .htaccess
Last active December 22, 2015 18:38
Lock wp-admin for everyone but IP address
#Put this in .htaccess inside wp-admin folder
Order deny,allow
Deny from all
allow from zzz.zzz.zzz.zzz
# Put this in main WP folder's .htaccess to limit access to wp-login.php
<Files wp-login.php>
Order deny,allow
Deny from all
allow from zzz.zzz.zzz.zzz
@lynettechandler
lynettechandler / functions.php
Last active December 24, 2015 00:39
Slideshare shortcode for self hosted WordPress
// Add slideshare shortcode
function tbm_slideshare( $atts ) {
$atts = extract( shortcode_atts(
array(
'id'=>''
),$atts ) );
// Break it up so we can get the first variable = presentation ID
$id = explode('&', $id);
return '<iframe src="http://www.slideshare.net/slideshow/embed_code/'.$id[0].'?rel=0" width="570" height="469" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC;border-width:1px 1px 0;margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>';
}
@lynettechandler
lynettechandler / style.css
Created October 19, 2013 16:45
Style plugin CSS fixes for different themes.
/* Genesis Serenity */
#content .post UL.snzpli-bullet LI, #content .post UL.snzpli-plus LI, #content .post UL.snzpli-check LI, #content .post UL.snzpli-ast LI, #content .post UL.snzpli-star LI, #content .post UL.snzpli-cross LI, #content .post UL.snzpli-arrow LI, #content .post UL.snzpli-alert LI, #content .post UL.snzpli-clock LI, #content .post ul.snzpli-bulb li, #content .post UL.snzpli-cancel LI, #content .post UL.snzpli-lock LI, #content .post UL.snzpli-new LI
{
list-style-type: none;
padding-left: 24px;
}
/* Genesis Serenity */
#content img, #content p img {
background: none;
padding: 0;
@lynettechandler
lynettechandler / 0_reuse_code.js
Created December 23, 2013 05: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
{
"name": "example-project",
"version": "0.1.0",
"devDependencies": {
"grunt": "~0.4.1"
}
}
@lynettechandler
lynettechandler / CopyrightYear
Created January 14, 2014 15:01
Copyright with automatically updating year.
&copy; Copyright 2005 - <?php echo date('Y'); ?>