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_action( 'after_setup_theme', 'my_plugin_force_ssl' ); | |
/** | |
* Force unencrypted URLs to redirect to an SSL encrypted version. | |
*/ | |
function my_plugin_force_ssl() { | |
$protocol = stripos( $_SERVER['SERVER_PROTOCOL'],'https' ) === true ? 'https://' : 'http://'; | |
if( $protocol == 'http://' ) { |
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_action( 'after_setup_theme', 'my_theme_setup' ); | |
function my_theme_setup() { | |
/* Customize the canonical URL. */ | |
remove_filter( 'wp_head', 'rel_canonical' ); | |
add_filter( 'wp_head', 'my_rel_canonical' ); | |
} | |
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
$(document).ready(function () { | |
getRate( 'Dealer: New', 72, 72, '.rate-new-72-72' ); | |
}); | |
/** | |
* Retrieves the interest rate for given minimum and maximum month terms. | |
* | |
* @arg type string Required. The description of the product. |
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: Media Shortcode | |
* Author: developdaly | |
* Version: 1.0 | |
* Description: This shortcode will reference a media item, configurable via attributes. Using a shortcode is more flexible and won't require database search/replace when migrating domains. | |
* | |
* ex. [media id="97"] = <img src="http://example.com/97-300x150.jpg" class="thumbnail"> | |
* | |
*/ |
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 | |
// Check the current host or server name | |
if (isset($_SERVER['HTTP_HOST'])) { | |
$host = $_SERVER['HTTP_HOST']; | |
} elseif (isset($_SERVER['SERVER_NAME'])) { | |
$host = $_SERVER['SERVER_NAME']; | |
} | |
// Switch the host to the desired domain |
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 | |
/** | |
* This function looks for the directory that "wp-config.php" resides in | |
* and then looks for a file named ".revision", the content of which is a | |
* single integer set by Beanstalk upon deployment. | |
* | |
* The purpose is to version static resources so that browsers will | |
* re-download any cached, outdated versions with the newer version. | |
* |