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
/** | |
* Create widgetized sidebars for each page | |
*/ | |
function xxx_custom_page_sidebars() { | |
$pages = get_pages( array( | |
'parent' => 0 | |
) | |
); | |
foreach ( $pages as $page ) { |
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 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 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 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 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 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. | |
## | |
######### |
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
#!/bin/sh | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# Set the colours you can use | |
black='\033[0;30m' | |
white='\033[0;37m' | |
red='\033[0;31m' |
NewerOlder