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
/** | |
* Create widgetized sidebars for each page | |
*/ | |
function xxx_custom_page_sidebars() { | |
$pages = get_pages( array( | |
'parent' => 0 | |
) | |
); | |
foreach ( $pages as $page ) { |
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
function degweb_protected_title_trim($title) { | |
$title = attribute_escape($title); | |
$findthese = array( | |
'#Protected:#', | |
'#Private:#' | |
); | |
$replacewith = array( | |
'', // What to replace "Protected:" with | |
'' // What to replace "Private:" with | |
); |
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 if(!empty($post->post_excerpt)) { | |
//This post have an excerpt, let's display it | |
the_excerpt(); | |
} else { | |
// This post have no excerpt | |
} ?> |
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
/* | |
* Check for the current environment | |
*/ | |
//define('WP_CACHE', true); //Added by WP-Cache Manager | |
if ($_SERVER["HTTP_HOST"] === 'domain.com') { | |
$db_name = 'dbname'; | |
$db_user = 'dbuser'; | |
$password = 'dbass'; | |
} else if ($_SERVER["HTTP_HOST"] === 'local') { |
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 | |
/* | |
* Plugin Name: EnvatoWP Bug Hunt One | |
* Plugin URI: https://gist.github.com/ | |
* Description: Bug Hunt One - Find all the bugs in this basic plugin | |
* Version: 0.1 | |
* Author: EnvatoWP | |
* Author URI: http://envatowp.github.com/ | |
* License: GPL2 | |
*/ |
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
#!/bin/bash | |
# Where should this file be stored? | |
ipfile=~/Desktop/external-ip.txt | |
# Go ahead now, go ahead and get that IP | |
IP=$(curl -s http://icanhazip.com) | |
# Has the address changed? If it has go ahead and write that bad boy down. If not, no worries. | |
OLDIP="" |
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
#!/bin/bash | |
########## | |
## Setup: hardcode your mysql user/pass. Yeah, yeah, I know...it's frowned upon. | |
## but for local development, I have no problem with it. | |
## Find and replace: MYSQLUSER / MYSQLPASS | |
## | |
## Usage: This script accepts only one variable, the site name. | |
## | |
######### |
NewerOlder