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 | |
// Replace primary navigation to remove unnecessary "Main navigation" heading, duplicated in ARIA label | |
remove_action( 'genesis_after_header', 'genesis_do_nav' ); | |
add_action( 'genesis_after_header', 'scl_do_nav' ); | |
function scl_do_nav() { | |
//* Do nothing if menu not supported | |
if ( ! genesis_nav_menu_supported( 'primary' ) || ! has_nav_menu( 'primary' ) ) | |
return; | |
$class = 'menu genesis-nav-menu menu-primary'; |
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 | |
remove_meta_box( 'postexcerpt', 'post', 'side' ); | |
// use original box: | |
// add_meta_box('postexcerpt', __( 'Plain Text Summary' ), 'post_excerpt_meta_box', 'post', 'normal', 'high'); | |
// replace box altogether: | |
add_meta_box( 'postexcerpt', __( 'Plain Text Summary' ), 'custom_post_excerpt_meta_box', 'post', 'normal', 'high' ); | |
function custom_post_excerpt_meta_box( $post ) { | |
?> |
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 | |
/* | |
Plugin Name: Citation Importer Filters | |
Plugin URI: http://stephanieleary.com/ | |
Description: Add or edit fields for the Citation Importer. | |
Author: sillybean | |
Author URI: http://stephanieleary.com/ | |
Version: 0.1 | |
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
*/ |
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 | |
// [file fragment] | |
// find this, around line 671 | |
// ... and all the taxonomies... | |
$taxonomies = get_taxonomies( array( 'public' => true ), 'objects', 'and' ); | |
foreach ( $taxonomies as $tax ) { | |
if ( isset( $options[$tax->name] ) ) | |
wp_set_post_terms( $post_id, $options[$tax->name], $tax->name, false ); | |
} | |
if ( isset( $customfieldtags ) ) |
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 excerpts to pages | |
add_post_type_support( 'page', 'excerpt' ); | |
//* Use excerpts as Featured Page widget content | |
add_filter( 'get_the_content_limit', 'ebca_content_limit', 10, 4 ); | |
function ebca_content_limit( $output, $content, $link, $max_characters ) { | |
$content = get_post_field( 'post_excerpt', get_the_ID() ); |
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
[searchwp_search_form engine="employee_directory" placeholder="Search for a name or custom field"] <!-- new --> | |
[searchwp_search_results_found] <!-- new --> | |
<div class="search-results-wrapper"> | |
<h3>Search Results</h3> | |
[searchwp_search_results engine="employee_directory" posts_per_page=20] | |
<h4>[searchwp_search_result_link direct="true"]</h4> | |
[searchwp_search_result_excerpt] | |
[/searchwp_search_results] | |
</div> |
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
[searchwp_search_form engine="employee_directory"] | |
<div class="search-results-wrapper"> | |
<h3>Search Results</h3> | |
[searchwp_search_results engine="employee_directory" posts_per_page=20] | |
<h4>[searchwp_search_result_link direct="true"]</h4> | |
[searchwp_search_result_excerpt] | |
[/searchwp_search_results] | |
</div> | |
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
$('li.blurb').each(function(index) { | |
var words = $('dd.words', this).text(); | |
words = words.replace(',', ''); | |
words = parseInt(words, 10); | |
if ( words > 2000 ) | |
words = Math.round(words / 1000) + 'K'; | |
var title = $('h4.heading', this).html(); | |
title = title.replace(/(\r\n|\n|\r)/gm, ' '); | |
title = title.replace('<!-- do not cache -->', ''); |
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() ) { | |
// HTML Import redirects | |
$posts = get_posts( array( | |
'meta_key' => 'URL_before_HTML_Import', | |
'meta_value' => $request_url, |