This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_tracking_code() { | |
echo 'Paste tracking code from Google Analytics here'; | |
} | |
add_action( 'wp_footer', 'my_tracking_code' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: dropkick | |
* Plugin URI: http://d8c.us/ | |
* Description: Rewrite local image locations to dropbox locations | |
* Version: 0.2 | |
* Author: Jonas M Luster <j@d8c.us> | |
* Author URI: http://feastcraft.com | |
* License: GPL3 | |
* */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For this script to work, save it somewhere in the executable path, like /usr/local/sbin/backup.sh | |
# make it executable: chmod +x /usr/local/sbin/backup.sh | |
# then add it to cron: crontab -e | |
# and add the line below, which will run backup 3am each day, then upload to Dropbox | |
# 0 3 * * * /usr/local/sbin/backup.sh > /dev/null 2>&1 | |
# You also need WP CLI installed: http://wp-cli.org/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add magic quotes to $_GET, $_POST, $_COOKIE, and $_SERVER. | |
* | |
* Also forces $_REQUEST to be $_GET + $_POST. If $_SERVER, $_COOKIE, | |
* or $_ENV are needed, use those superglobals directly. | |
* | |
* @access private | |
* @since 3.0.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set .htpasswd for wp-admin. Place this code in .htaccess within wp-admin folder. | |
AuthType Basic | |
AuthName "Your prefered name" | |
AuthUserFile /path/to/.htpasswd # Path must be absolute. | |
Require user user1 user2 user3 | |
# Deny access to wp-config.php file. | |
<Files wp-config.php> | |
Order allow, deny | |
Deny from all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Simple Contact Form Shortcode | |
Plugin URI: http://wp.tutsplus.com/author/barisunver/ | |
Description: A simple contact form for simple needs. Usage: <code>[contact email="your@email.address"]</code> | |
Version: 1.0 | |
Author: Barış Ünver | |
Author URI: http://beyn.org/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'posts_per_page' => '4', | |
'exclude' => array( $post->ID ) | |
); | |
// get posts | |
$posts = get_posts( $args ); | |
// check if any posts are returned | |
if ( $posts ) { ?> |