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 | |
// Redirect wp-login.php to custom url | |
add_action( 'login_form_login', 'mwm_redirect_login' ); | |
function mwm_redirect_login() { | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
// Redirect wp-login.php?action=register to custom url |
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 | |
// Stay logged in | |
add_filter( 'auth_cookie_expiration', 'mwm_keep_me_logged_in_for_4_weeks' ); | |
function mwm_keep_me_logged_in_for_4_weeks( $expirein ) { | |
return 2419200; // 4 weeks in seconds | |
} |
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 | |
//* Disable toolbar for non admins | |
add_action('after_setup_theme', 'mwm_remove_admin_bar'); | |
function mwm_remove_admin_bar() { | |
if ( !current_user_can('administrator') && !is_admin() ) { | |
show_admin_bar(false); | |
} | |
} |
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 | |
//* Remove toolbar from frontend and remove CSS that bumps content down | |
add_filter( 'show_admin_bar', 'bhl_hide_admin_bar_from_front_end' ); | |
function bhl_hide_admin_bar_from_front_end(){ | |
if ( ! current_user_can('manage_options') ) { | |
return false; | |
// Remove CSS | |
remove_action( 'wp_head', '_admin_bar_bump_cb' ); |
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 | |
add_filter( 'manage_edit-resident_columns', 'set_custom_edit_resident_columns' ); | |
add_action( 'manage_resident_posts_custom_column' , 'custom_resident_column', 10, 2 ); | |
function set_custom_edit_resident_columns($columns) { | |
$columns = array( | |
'cb' => '<input type="checkbox" />', | |
'title' => 'Title', | |
'display' => 'Display', |
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 | |
/** | |
* Change size of comment avatars. | |
*/ | |
add_filter( 'genesis_comment_list_args', 'childtheme_comment_list_args' ); | |
function childtheme_comment_list_args( $args ) { | |
$args['avatar_size'] = 90; | |
return $args; | |
} |
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
/* actions fired when listing/adding/editing posts or pages */ | |
/* admin_head-(hookname) */ | |
add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
function admin_head_post_editing() { | |
echo 'you are editing a post'; | |
} |
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 ( document, $, undefined ) { | |
'use strict'; | |
// Initiate side menu | |
$( '#edit-toggle' ).sidr({ | |
name: 'edit-post', | |
side: 'left', | |
renaming: false, | |
// displace: false, | |
onOpen: function() { |
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
.sidr { | |
display: none; | |
position: fixed; | |
top: 0; | |
height: 100%; | |
width: 100%; | |
max-width: 500px; | |
left: -500px; | |
right: auto; | |
background: #fff; |
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 // Put this code in functions.php or a custom plugin. Don't include opening php tag. | |
/** | |
* Register scripts to enqueue in our shortcode | |
* @author Mike Hemberger | |
* @link http://thestizmedia.com/shortcode-to-show-map-markers-of-child-pages-with-acf-pro/ | |
*/ | |
add_action('wp_enqueue_scripts', 'tsm_register_non_global_scripts'); | |
function tsm_register_non_global_scripts() { | |
wp_register_script( 'google-map', 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false', array(), '3', true ); |