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
echo $GLOBALS['wp_query']->request; |
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
$obj = json_decode($save); | |
$xml = $xmls->serialize($obj); | |
file_put_contents($file, $xml); |
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
if( !$post->post_parent ){ // If is a parent page | |
$parent_id = $post->ID; | |
} else { // If is a child | |
if( $post->ancestors ) { | |
$parent_id = end( $post->ancestors ); | |
} | |
} | |
if ($children) { | |
echo "<ul class='page-children'>"; |
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
/* Basic Selectors */ | |
#name /* <div id='name'> */ | |
.name{} /* <div class='name'> */ | |
.parent.name{} /* <div class='parent name'> */ | |
.parent .child{} /* Child Element <div class='parent'> <div class='child'> */ | |
.parent > .child{} /* Direct Child Element ONLY (grandchildren will be ignored) */ | |
.one + .two{} /* Directly Adjoining Elements <div class='one'></div> <div class='two'></div> */ | |
.one ~ .two{} /* Any Following Elements */ | |
/* dynamic selectors */ |
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
*, *:before, *:after { | |
-moz-box-sizing: border-box; | |
-webkit-box-sizing: border-box; | |
box-sizing: border-box; | |
} |
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 make_comparer() { | |
// Normalize criteria up front so that the comparer finds everything tidy | |
$criteria = func_get_args(); | |
foreach ($criteria as $index => $criterion) { | |
$criteria[$index] = is_array($criterion) | |
? array_pad($criterion, 3, null) | |
: array($criterion, SORT_ASC, null); | |
} | |
return function($first, $second) use (&$criteria) { |
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
add_filter('gform_pre_render_3', 'populate_fields_contact'); // Document Form | |
function populate_fields_contact( $form ){ | |
// Make sure we're editing the object correctly | |
if ( $_GET['update_contact'] ){ | |
// Set our default values | |
$data_type = "contact"; | |
$data_type_length = 8; // 'contact_' = 8 char |
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
/** | |
* Remove admin bar & admin access for non-managers & non-admins | |
* @access public | |
* @since 0.1.0 | |
*/ | |
add_action('admin_init', 'no_mo_dashboard'); | |
add_action('after_setup_theme', 'remove_admin_bar'); | |
function no_mo_dashboard() { | |
if ( ! current_user_can( 'edit_others_posts' ) && '/wp-admin/admin-ajax.php' != $_SERVER['PHP_SELF'] ) { | |
wp_redirect( site_url() ); exit; |
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
/** | |
* Keep a failed login attempt on the same page instead of re-directing to backend | |
* @access public | |
* @since 0.1.0 | |
*/ | |
add_action( 'wp_login_failed', 'my_front_end_login_fail' ); // hook failed login | |
function my_front_end_login_fail( $username ) { | |
$referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from? | |
if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) { |
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 adjust_header_banner(){ | |
var footer = $('.footer'); | |
count = 0; | |
totalWidth = 0; | |
// Calculate distance between partner images | |
$('.partners img').each(function() { | |
totalWidth += $(this).width(); | |
count += 1; |