Run the following commands:
find /path/to/your/wordpress/install/ -type d -exec chmod 755 {} \;
find /path/to/your/wordpress/install/ -type f -exec chmod 644 {} \;
head.ready(function() { | |
if(navigator.userAgent.match('CriOS')) head.feature("chrome-ios", true); | |
else head.feature("chrome-ios", false); | |
}); |
<?php | |
/* | |
* Validate Facebook URL field | |
* URL field must be named "facebook_video_url" or you can change is in the filter below. | |
* Source: https://www.advancedcustomfields.com/resources/acf-validate_value/ | |
*/ | |
function acf_validate_facebook_url( $valid, $value, $field, $input ){ | |
// If already not valid, then exit | |
if( !$valid ) { | |
return $valid; |
<?php | |
/** | |
* Wrap with Link if URL passed | |
*/ | |
function wrap_if_linked($text, $url) { | |
if($url) { | |
echo('<a href="' . $url . '">' . $text . '</a>'); | |
} else { | |
echo($text); | |
} |
# Redirect to homepage | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule .? http://example.com/ [R=301,L] |
AL : Alabama | |
AK : Alaska | |
AS : American Samoa | |
AZ : Arizona | |
AR : Arkansas | |
CA : California | |
CO : Colorado | |
CT : Connecticut | |
DE : Delaware | |
DC : District of Columbia |
<?php | |
/** | |
* Build a name | |
*/ | |
function build_name($prefix, $fname, $lname, $suffix) { | |
$name = $fname . ' ' . $lname; | |
if($prefix) $name = $prefix . ' ' . $name; | |
if($suffix) $name = $name .= $suffix; | |
return $name; | |
} |
<?php | |
/** | |
* Build Comma-Separated String | |
* Won't add a hanging comma if there's only passed value | |
*/ | |
function comma_separated($array) { | |
$string = implode(', ', $array); | |
if (preg_match("/, $/", $string)) { // if it ends in a comma, remove the comma | |
$string = substr($string, 0, -2); | |
} |