Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #1032 from olefredrik/active-class-menu-item
Browse files Browse the repository at this point in the history
Active class menu item
  • Loading branch information
olefredrik committed Aug 8, 2017
2 parents 5ba127e + 29cb728 commit e063c5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/foundation.php
Expand Up @@ -62,10 +62,10 @@ function foundationpress_menu_fallback() {
}
endif;

// Add Foundation 'is-ctive' class for the current menu item.
// Add Foundation 'is-active' class for the current menu item.
if ( ! function_exists( 'foundationpress_active_nav_class' ) ) :
function foundationpress_active_nav_class( $classes, $item ) {
if ( 1 === $item->current || true === $item->current_item_ancestor ) {
if ( $item->current == 1 || $item->current_item_ancestor == true ) {
$classes[] = 'is-active';
}
return $classes;
Expand All @@ -74,14 +74,14 @@ function foundationpress_active_nav_class( $classes, $item ) {
endif;

/**
* Use the active class of ZURB Foundation on wp_list_pages output.
* Use the is-active class of ZURB Foundation on wp_list_pages output.
* From required+ Foundation http://themes.required.ch.
*/
if ( ! function_exists( 'foundationpress_active_list_pages_class' ) ) :
function foundationpress_active_list_pages_class( $input ) {

$pattern = '/current_page_item/';
$replace = 'current_page_item active';
$replace = 'current_page_item is-active';

$output = preg_replace( $pattern, $replace, $input );

Expand Down

0 comments on commit e063c5d

Please sign in to comment.