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
/** The name of the database for WordPress */ | |
define('DB_NAME', 'wp_db_prod_main'); | |
/** MySQL database username */ | |
define('DB_USER', 'wp_db_prod'); | |
/** MySQL database password */ | |
define('DB_PASSWORD', 'passmyWPw0rd!'); | |
/** MySQL hostname */ |
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
cd /var/www/html | |
wget http://wordpress.org/latest.tar.gz | |
tar -xzvf latest.tar.gz | |
mv wordpress blog | |
//setup wp-config | |
cd blog | |
mv wp-config-sample.php wp-config.php | |
vi wp-config.php |
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
yum install php php-mysql | |
service httpd restart | |
cd /var/www/html | |
vi test.php |
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
ssh -i "WP_Key_Pair.pem" [email protected] | |
sudo su | |
yum install httpd | |
service httpd start |
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
add_filter( ‘title_save_pre’, ‘add_sitename_to_title’, 10, 2 ); | |
add_sitename_to_title( $title, $sep ) { | |
// You might want to check whether the title has been added already before appending the title (again) | |
/* Retrieve site name. */ | |
$name = get_bloginfo( ‘name’ ); | |
/* Append site name to $title. */ |
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
//Google Universal Analytics | |
function google_analytics() { ?> | |
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'GA-XXXXXX-XX', 'auto'); | |
ga('send', 'pageview'); |
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 publish_post_to_social_media($post_ID) { | |
global $post; | |
// Send a tweet | |
... | |
//Push URL to Facebook page | |
... | |
//Send to Google+ page | |
... | |
} | |
add_action('publish_post', 'publish_post_to_social_media'); |
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 send_bonus_email( $form_id, $user_data, $user_id ) | |
{ | |
global $service_locator; | |
$firstName = $user_data['first_name']; | |
$lastName = $user_data['last_name']; | |
$email_content = " | |
Hey there $firstName, Welcome to WPMUDEV. "\r\n" |
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 add_attribution_backlink( $content ) { | |
// Process content here and add the backlink | |
$backlink = ‘<div class=”attribution”>This article first appeared on <a href=”http://premium.wpmudev.org/blog”>WPMU Dev Blog</a></div>’; | |
$content = $content . $backlink; | |
return $content; | |
} | |
add_filter( 'content_save_pre', ‘add_attribution_backlink’, 10, 1 ); |
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
//Add Open Graph Meta Info from the actual article data, or customize as necessary | |
function facebook_open_graph() { | |
global $post; | |
if ( !is_singular()) //if it is not a post or a page | |
return; | |
if($excerpt = $post->post_excerpt) | |
{ | |
$excerpt = strip_tags($post->post_excerpt); | |
$excerpt = str_replace("", "'", $excerpt); | |
} |
NewerOlder