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 | |
| if ( is_active_sidebar( 'after-entry' ) ) { | |
| genesis_widget_area( 'after-entry', array( | |
| 'before' => '<div class="after-entry">', | |
| 'after' => '</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
| // Add custom code to Genesis primary navigation extras | |
| // @link http://www.rfmeier.net/add-a-custom-primary-nav-extras-within-genesis/ | |
| add_filter( 'wp_nav_menu_items', 'custom_nav_item', 10, 2 ); | |
| function custom_nav_item( $menu, stdClass $args ){ | |
| // make sure we are in the primary menu | |
| if ( 'primary' != $args->theme_location ) | |
| return $menu; | |
| // see if a nav extra was already specified with Theme options |
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
| // Change Sorry no posts text for books | |
| add_filter( 'genesis_noposts_text', 'child_noposts_text' ); | |
| /**Changes the No Posts text for search pages */ | |
| function child_noposts_text() { | |
| if ( is_post_type_archive('download') OR ( is_tax('download_category' ) ) ) { | |
| return '<span class="no-posts">' . __( 'Sorry, no books matched your criteria.', 'genesis' ) . '</span>'; | |
| } | |
| } |
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
| // Show post content if it exists | |
| $post = get_post($post->ID); | |
| if($post->post_content=="") { | |
| echo '<p>No description provided.</p>'; | |
| } else { | |
| genesis_do_post_content(); | |
| } |
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 custom body class to the head | |
| add_filter( 'body_class', 'sp_body_class' ); | |
| function sp_body_class( $classes ) { | |
| if ( is_page( 'sample-page' )) | |
| $classes[] = 'custom-class'; | |
| return $classes; | |
| } |
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 | |
| // Include custom post types in search | |
| // @link http://thomasgriffinmedia.com/blog/2010/11/how-to-include-custom-post-types-in-wordpress-search-results/ | |
| add_action('pre_get_posts', 'include_post_types_in_search'); | |
| function include_post_types_in_search( $query ) { | |
| if ( $query->is_search ) | |
| $query->set( 'post_type', array( 'post', 'download' ) ); | |
| return $query; | |
| }; |
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 | |
| // Shorten Excerpt | |
| add_filter( 'genesis_pre_get_option_content_archive_limit', 'child_shorten_excerpt' ); | |
| function child_shorten_excerpt( $length ) { | |
| $length = 200; | |
| return $length; | |
| } |
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 custom post types to archive/sitemap | |
| add_filter( 'getarchives_where' , 'ucc_getarchives_where_filter' , 10 , 2 ); | |
| function ucc_getarchives_where_filter( $where , $r ) { | |
| $args = array( 'public' => true , '_builtin' => false ); | |
| $output = 'names'; $operator = 'and'; | |
| $post_types = get_post_types( $args , $output , $operator ); $post_types = array_merge( $post_types , array( 'post' ) ); $post_types = "'" . implode( "' , '" , $post_types ) . "'"; |
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 the shortcode column from Downloads dashboard | |
| add_filter( 'edd_download_columns', 'child_remove_edd_shortcode_column' ); | |
| function child_remove_edd_shortcode_column( $download_columns ) { | |
| unset( $download_columns['shortcode'] ); | |
| return $download_columns; | |
| } | |
| ?> |