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
/* Genesis Settings screen */ | |
#berkeley-color-settings .genesis-layout-selector label.box { | |
max-height: inherit; | |
} | |
.genesis-layout-selector label.box { | |
padding: 5px; | |
} |
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
<?php | |
// Register admin stylesheet | |
add_action( 'admin_enqueue_scripts', 'berkeley_settings_admin_styles' ); | |
function berkeley_settings_admin_styles( $hook ) { | |
wp_enqueue_style( 'berkeley-admin-css', get_stylesheet_directory_uri() . '/css/admin-style.css' ); | |
} |
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
<?php | |
// Change placeholder text for post titles | |
add_filter( 'enter_title_here', 'my_title_placeholders' ); | |
function my_title_placeholders( $placeholder ){ | |
$screen = get_current_screen(); | |
switch ( $screen->post_type ) { | |
case 'people': | |
$placeholder = __( 'Enter full name' ); |
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
<?php | |
add_filter( 'genesis_noposts_text', 'my_custom_404_message', 10, 2 ); | |
function my_custom_404_message( $text ) { | |
$queried_object = get_queried_object(); | |
if ( isset( $queried_object->post_status ) && 'private' == $queried_object->post_status && !is_user_logged_in() ) | |
$text = sprintf( __( 'This page is restricted. Please <a href="%s">log in or register</a>.' ), wp_login_url( $_SERVER['REQUEST_URI'] ) ); | |
elseif ( is_search() ) |
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
<?php | |
add_filter( 'term_link', 'taxonomy_link_for_post_type', 10, 3 ); | |
function taxonomy_link_for_post_type( $termlink, $term, $taxonomy ) { | |
$tax_obj = get_taxonomy( $taxonomy ); | |
// if this is not a shared taxonomy, bail | |
if ( count( $tax_obj->object_type ) == 1 ) |
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
<?php | |
function berkeley_find_post_type() { | |
$type = get_query_var( 'post_type' ); | |
if ( ( !isset( $type ) || empty( $type ) ) && is_tax() ) { | |
// we're on a term archive, where post type might not be set but can be inferred from taxonomy's object_type | |
$current_term = get_queried_object(); | |
$tax_obj = get_taxonomy( $current_term->taxonomy ); |
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
<?php | |
add_action( 'admin_init', 'my_close_meta_boxes', 99 ); | |
function my_close_meta_boxes() { | |
$post_types = get_post_types( array( 'public' => true ) ); | |
foreach ( $post_types as $type ) { | |
// Close Excerpt on all post types | |
add_filter( "postbox_classes_{$type}_postexcerpt", 'my_custom_closed_meta_boxes' ); | |
} |
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
<?php | |
add_filter( 'default_hidden_meta_boxes', 'custom_default_hidden_screen_options', 10, 2 ); | |
function custom_default_hidden_screen_options( $hidden, $screen ) { | |
$hide_these = array( | |
'dashboard_primary', | |
'postcustom', | |
'trackbacksdiv', |
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
<?php | |
add_filter( 'redirect_canonical', 'my_404_no_guessing', 10, 2 ); | |
function my_404_no_guessing( $redirect_url, $request_url ) { | |
if ( is_404() ) { | |
// Drupal redirects | |
$posts = get_posts( array( | |
'meta_key' => 'drupal_path', // change to your meta_key | |
'meta_value' => parse_url( $request_url, PHP_URL_PATH ), |
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
<?php | |
add_action( 'wp', 'my_private_page_404' ); | |
function my_private_page_404() { | |
$queried_object = get_queried_object(); | |
if ( isset( $queried_object->post_status ) && 'private' == $queried_object->post_status && !is_user_logged_in() ) { | |
wp_safe_redirect( add_query_arg( 'private', '1', wp_login_url( $_SERVER['REQUEST_URI'] ) ) ); | |
exit; | |
} |