Skip to content

Instantly share code, notes, and snippets.

View siriokun's full-sized avatar
Prompting in five minutes to develop five weeks of work

Rio Purnomo siriokun

Prompting in five minutes to develop five weeks of work
View GitHub Profile
@siriokun
siriokun / wp-config.php
Created January 7, 2013 10:32 — forked from anonymous/wp-config.php
This in wp-config to be able to run the blog both locally and deployed on AppFog
$services = getenv("VCAP_SERVICES");
if ( $services != null){
$services_json = json_decode($services,true);
$mysql_config = $services_json["mysql-5.1"][0]["credentials"];
define('DB_NAME', $mysql_config["name"]);
define('DB_USER', $mysql_config["user"]);
define('DB_PASSWORD', $mysql_config["password"]);
define('DB_HOST', $mysql_config["hostname"]);
define('DB_PORT', $mysql_config["port"]);
<?php
/**
* Modify the "Enter title here" text when adding new CPT, post or page
*
* @access public
* @since 1.0
* @return void
*/
function rc_change_default_title( $title ){
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@siriokun
siriokun / wp-update_tagline.php
Created June 11, 2012 13:16
Check if WordPress site description is default, show notice to update
<?php
/**
* Checks to see if your tagline is set to the default and shows an admin notice to update it
* Throw this in function.php for your theme
*/
if (get_option('blogdescription') == 'Just another WordPress site') { add_action('admin_notices', create_function( '', "echo '<div class=\"error\"><p>".sprintf(__('Please update your <a href="%s">tagline</a>', 'bb'), admin_url('options-general.php'))."</p></div>';" ) ); };
// Different approach
/**