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
<?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
/* =BEGIN: Check If Page Is Child | |
Source: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/ | |
---------------------------------------------------------------------------------------------------- */ | |
function is_child( $page_id_or_slug ) { // $page_id_or_slug = The ID of the page we're looking for pages underneath | |
global $post; // load details about this page | |
if ( !is_numeric( $page_id_or_slug ) ) { // Used this code to change a slug to an ID, but had to change is_int to is_numeric for it to work. | |
$page = get_page_by_path( $page_id_or_slug ); | |
$page_id_or_slug = $page->ID; | |
} |
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_action( 'tgmsp_before_slider_output', 'tgm_custom_slider_theme' ); | |
function tgm_custom_slider_of_madness( $id ) { | |
// If not the proper slider ID, do nothing. Change to match your slider ID. | |
if ( '324' !== $id ) return; | |
// Dequeue the default styles. | |
wp_dequeue_style( 'soliloquy-style' ); | |
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 | |
function change_author_capabilities() { | |
$role = get_role( 'shop_vendor' ) ; | |
$role->add_cap( 'delete_published_products' ); | |
} | |
add_action( 'admin_init', 'change_author_capabilities' ); |
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 | |
function change_post_label() { | |
global $menu; | |
global $submenu; | |
$menu[5][0] = 'News'; | |
$submenu['edit.php'][5][0] = 'News'; | |
$submenu['edit.php'][10][0] = 'Add News'; | |
$submenu['edit.php'][16][0] = 'News Tags'; |
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 | |
function change_author_capabilities() { | |
$role = get_role( 'author' ) ; | |
$role->remove_cap( 'edit_published_posts' ); | |
$role->remove_cap( 'publish_posts' ); | |
$role->remove_cap( 'delete_published_posts' ); | |
$role->remove_cap( 'edit_posts' ); | |
$role->remove_cap( 'delete_posts' ); |
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(is_plugin_active('memberpress/memberpress.php')) { | |
add_action( 'user_register', 'mp_auto_enroll' ); | |
//add_action( 'gform_user_registered', 'mp_auto_enroll', 10, 4 ); | |
function mp_auto_enroll($user_id, $user_config=array(), $entry='', $user_pass='') { | |
$txn = new MeprTransaction(); | |
$txn->user_id = $user_id; |
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 eNews and Updates widget | |
add_action( 'widgets_init', 'remove_enews_updates_widget', 20 ); | |
function remove_enews_updates_widget() { | |
unregister_widget( 'Genesis_eNews_Updates' ); | |
} | |
// Remove Featured Page widget | |
add_action( 'widgets_init', 'remove_featured_page_widget', 20 ); |
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 | |
// Customize search form input box text | |
add_filter( 'genesis_search_text', 'custom_search_text' ); | |
function custom_search_text($text) { | |
return esc_attr( 'Search my blog...' ); | |
} | |
// Customize search form input button text | |
add_filter( 'genesis_search_button_text', 'custom_search_button_text' ); |
NewerOlder