/** * Add body class if sidebar is active * @param Array $classes Add class if the sidebar is active * @return Array Classes array to be added to the DOM */ function aiga_nebraska_sidebar_body_class($classes) { if (display_sidebar()) { $classes[] = 'sidebar-primary'; } return $classes; }
?> <?php wp_reset_postdata(); ?> <?php } else { ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?> </p> <?php } ?> </div> <div class="<?php display_sidebar(); ?> "> <?php get_sidebar(); ?> </div> </div> </div> <!-- Main Content Section Ends Here --> <!-- Content Ends Here --> <div class="margin-bottom-sm"></div> <!-- Footer Begins Here --> <?php get_footer();
namespace App; /** * Add <body> classes */ add_filter('body_class', function (array $classes) { // Add page slug if it doesn't exist if (is_single() || is_page() && !is_front_page()) { if (!in_array(basename(get_permalink()), $classes)) { $classes[] = basename(get_permalink()); } } // Add class if sidebar is active if (display_sidebar()) { $classes[] = 'sidebar-primary'; } return $classes; }); /** * Add "… Continued" to the excerpt */ add_filter('excerpt_more', function () { return ' … <a href="' . get_permalink() . '">' . __('Continued', 'sage') . '</a>'; }); /** * Template Hierarchy should search for .blade.php files