This file contains hidden or 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 | |
/** | |
* 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 | |
/** |
This file contains hidden or 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 | |
function themename_customize_register($wp_customize){ | |
$wp_customize->add_section('themename_color_scheme', array( | |
'title' => __('Color Scheme', 'themename'), | |
'priority' => 120, | |
)); | |
// ============================= |
This file contains hidden or 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 | |
/** | |
* 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 ){ |
This file contains hidden or 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
$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"]); |
This file contains hidden or 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 | |
function showalltags() { | |
$tags = get_tags(); | |
$html; | |
foreach ($tags as $tag){ | |
$tag_link = get_tag_link($tag->term_id); | |
$html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>"; |
This file contains hidden or 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
<ul id="slidecontrols"> | |
<li><a href="#one">One</li> | |
<li><a href="#two">Two</li> | |
</ul> | |
<div id="slides"> | |
<div>This is content block One</div> | |
<div>This is content block Two</div> | |
</div> |
This file contains hidden or 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
a[href^="http://"] { | |
/* fully valid URL, likely external link */ | |
} | |
a[href="http://google.com"] { | |
/* link to specific website */ | |
} | |
a[href^="/"], a[href^=".."] { | |
/* internal relative link */ |
This file contains hidden or 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
$.loadCss=function(css){$('head').append('<link rel="stylesheet" type="text/css" href="'+css+'">')}; |
This file contains hidden or 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
/* -------------------------------------- */ | |
//iOS-like scrollbar | |
var $niceScrollContainers = $("[data-ios-scroll]"); | |
$niceScrollContainers.each(function () { | |
var $container = $(this), | |
scrollClass = $container.attr("data-ios-scroll"), | |
cursorWidth = "6px", | |
$contentsLastChild = $container.children("*:last-child"); |
This file contains hidden or 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
//jQuery | |
$("#swapImg") | |
.attr("src", "dynamic-image-url.jpg") | |
.one("load",function(){ | |
//image has loaded | |
}) | |
.each(function(){ | |
if(this.complete) //trigger load if cached in certain browsers | |
$(this).trigger("load"); |
OlderNewer