diff --git a/web/app/themes/mitlib-news/functions.php b/web/app/themes/mitlib-news/functions.php index 56311023..333fecd2 100644 --- a/web/app/themes/mitlib-news/functions.php +++ b/web/app/themes/mitlib-news/functions.php @@ -115,6 +115,28 @@ function remove_parent_widgets() { } add_action( 'widgets_init', 'Mitlib\News\remove_parent_widgets', 11 ); +/** + * Expands the category display, for categories that are not Bibliotech issues, + * to include content from all post types (Spotlights and Bibliotech articles, + * in addition to Posts). + * + * @param object $request A request object. + */ +function expand_category_scope( $request ) { + $vars = $request->query_vars; + if ( is_category() && ! is_category( 'bibliotech' ) && ! array_key_exists( 'post_type', $vars ) ) : + $vars = array_merge( + $vars, + array( + 'post_type' => 'any', + ) + ); + $request->query_vars = $vars; + endif; + return $request; +} +add_filter( 'pre_get_posts', 'Mitlib\News\expand_category_scope' ); + /** * ============================================================================ * ============================================================================ diff --git a/web/app/themes/mitlib-news/lib/classes/nav-menu-dropdown.php b/web/app/themes/mitlib-news/lib/classes/nav-menu-dropdown.php deleted file mode 100644 index e621419d..00000000 --- a/web/app/themes/mitlib-news/lib/classes/nav-menu-dropdown.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @copyright Copyright (c) 2011, Bill Erickson - * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License - */ - -class Walker_Nav_Menu_Dropdown extends Walker_Nav_Menu { - function start_lvl( &$output, $depth ) { - $indent = str_repeat( "\t", $depth ); // don't output children opening tag (`