First, Lets find out what version of PHP we're running (To find out if it's the default version).
To do that, Within the terminal, Fire this command:
which php
<? | |
/** | |
* Repeatable Custom Fields in a Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* From a bespoke system, so currently not modular - will fix soon | |
* Note that this particular metadata is saved as one multidimensional array (serialized) | |
*/ | |
function hhs_get_sample_options() { |
#301 Redirects for .htaccess | |
#Redirect a single page: | |
Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
#Redirect an entire site: | |
Redirect 301 / http://www.domain.com/ | |
#Redirect an entire site to a sub folder | |
Redirect 301 / http://www.domain.com/subfolder/ |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
// Declare the color as RGB; SASS will treat this as hex | |
$green: rgb(27,224,63); | |
// Declare an alpha | |
$alpha: .5; | |
// Declare another color variable as a color with an alpha | |
$greenAlpha: rgba($green, $alpha); | |
body { | |
/* As RGB (which SASS actually ouputs as HEX) */ | |
background: $green; |
$counties = array( | |
"Alabama" => array( | |
"Autauga County", | |
"Baldwin County", | |
"Barbour County", | |
"Bibb County", | |
"Blount County", | |
"Bullock County", | |
"Butler County", | |
"Calhoun County", |
<?php | |
/** | |
* Check if a meta box has been registered. | |
* Returns true if the supplied meta box id has been registered. false if not. | |
* Note that this does not check what page type | |
* @param String $meta_box_id An id for the meta box. | |
* @param String $post_type The post type the box is registered to (optional) | |
* @return mixed Returns boolean or a WP_Error if $wp_meta_boxes is not yet set. | |
*/ |
<?php | |
// Exclude 'example' category from your blog | |
function my_get_terms_args_exclude( $args, $taxonomies ) { | |
if (!is_admin()) { | |
$cat = get_category_by_slug( 'example' ); | |
if ( is_object( $cat ) ) { | |
$args['exclude'] = $cat->term_id; | |
} | |
} |
add_action( 'genesis_before_comments' , 'webendev_comment_count' ); | |
/** | |
* Add comment count and remove standard comment title | |
* | |
*/ | |
function webendev_comment_count () { | |
add_filter( 'genesis_title_comments', '_return_null' ); | |
if ( is_single() ) { | |
if ( have_comments() ) { | |
echo '<h3>'; |