first commit
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* Drop down mobile style template part.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( 'dropdown' !== oceanwp_mobile_menu_style()
|
||||
|| ! oceanwp_display_navigation() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Navigation classes.
|
||||
$classes = array( 'clr' );
|
||||
|
||||
// If social.
|
||||
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
|
||||
$classes[] = 'has-social';
|
||||
}
|
||||
|
||||
// Turn classes into space seperated string.
|
||||
$classes = implode( ' ', $classes );
|
||||
|
||||
// Menu Location.
|
||||
$menu_location = apply_filters( 'ocean_main_menu_location', 'main_menu' );
|
||||
|
||||
// Dropdown menu attributes.
|
||||
$dropdown_menu_attrs = apply_filters( 'oceanwp_attrs_mobile_dropdown', '' );
|
||||
|
||||
// Menu arguments.
|
||||
$menu_args = array(
|
||||
'theme_location' => $menu_location,
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
);
|
||||
|
||||
// Check if custom menu.
|
||||
if ( $menu = oceanwp_header_custom_menu() ) {
|
||||
$menu_args['menu'] = $menu;
|
||||
}
|
||||
|
||||
// Left menu for the Center header style.
|
||||
$left_menu = get_theme_mod( 'ocean_center_header_left_menu' );
|
||||
$left_menu = '0' !== $left_menu ? $left_menu : '';
|
||||
$left_menu = apply_filters( 'ocean_center_header_left_menu', $left_menu );
|
||||
|
||||
// Menu arguments.
|
||||
$left_menu_args = array(
|
||||
'menu' => $left_menu,
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
);
|
||||
|
||||
// Top bar menu Location.
|
||||
$top_menu_location = 'topbar_menu';
|
||||
|
||||
// Menu arguments.
|
||||
$top_menu_args = array(
|
||||
'theme_location' => $top_menu_location,
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
);
|
||||
|
||||
// Get close menu text.
|
||||
$close_text = get_theme_mod( 'ocean_mobile_menu_close_text' );
|
||||
$close_text = oceanwp_tm_translation( 'ocean_mobile_menu_close_text', $close_text );
|
||||
$close_text = $close_text ? $close_text : esc_html__( 'Close', 'oceanwp' );
|
||||
|
||||
?>
|
||||
|
||||
<div id="mobile-dropdown" class="clr" <?php echo $dropdown_menu_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<nav class="<?php echo esc_attr( $classes ); ?>"<?php oceanwp_schema_markup( 'site_navigation' ); ?>>
|
||||
|
||||
<?php
|
||||
// If has mobile menu.
|
||||
if ( has_nav_menu( 'mobile_menu' ) ) {
|
||||
get_template_part( 'partials/mobile/mobile-nav' );
|
||||
} else {
|
||||
|
||||
// If has center header style and left menu.
|
||||
if ( 'center' === oceanwp_header_style()
|
||||
&& $left_menu ) {
|
||||
wp_nav_menu( $left_menu_args );
|
||||
}
|
||||
|
||||
// Navigation.
|
||||
wp_nav_menu( $menu_args );
|
||||
|
||||
// If has top bar menu.
|
||||
if ( has_nav_menu( $top_menu_location ) ) {
|
||||
wp_nav_menu( $top_menu_args );
|
||||
}
|
||||
}
|
||||
|
||||
// Social.
|
||||
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
|
||||
get_template_part( 'partials/header/social' );
|
||||
}
|
||||
|
||||
// Mobile search form.
|
||||
if ( get_theme_mod( 'ocean_mobile_menu_search', true ) ) {
|
||||
get_template_part( 'partials/mobile/mobile-search' );
|
||||
}
|
||||
?>
|
||||
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/**
|
||||
* Search for the full screen mobile style.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( 'fullscreen' !== oceanwp_mobile_menu_style() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Post type.
|
||||
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' ); ?>
|
||||
|
||||
<div id="mobile-search" class="clr">
|
||||
<form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="header-searchform" role="search" aria-label="<?php esc_attr_e( 'Mobile Search', 'oceanwp' ); ?>">
|
||||
<input type="search" name="s" value="" autocomplete="off" />
|
||||
<?php
|
||||
// If the headerSearchForm script is not disable.
|
||||
if ( OCEAN_EXTRA_ACTIVE
|
||||
&& class_exists( 'Ocean_Extra_Scripts_Panel' )
|
||||
&& Ocean_Extra_Scripts_Panel::get_setting( 'oe_headerSearchForm_script' ) ) {
|
||||
?>
|
||||
<label><?php oceanwp_theme_strings( 'owp-string-mobile-fs-search-text', 'oceanwp' ); ?><span><i></i><i></i><i></i></span></label>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php if ( 'any' !== $post_type ) { ?>
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
|
||||
<?php } ?>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
/**
|
||||
* Full screen mobile style template part.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( 'fullscreen' !== oceanwp_mobile_menu_style()
|
||||
|| ! oceanwp_display_navigation() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Navigation classes.
|
||||
$classes = array( 'clr' );
|
||||
|
||||
// If social.
|
||||
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
|
||||
$classes[] = 'has-social';
|
||||
}
|
||||
|
||||
// Turn classes into space seperated string.
|
||||
$classes = implode( ' ', $classes );
|
||||
|
||||
// Fullscreen menu attributes.
|
||||
$fullscreen_menu_attrs = apply_filters( 'oceanwp_attrs_mobile_fullscreen', '' );
|
||||
$fs_menu_close_attrs = apply_filters( 'oceanwp_attrs_mobile_fullscreen_close', '' );
|
||||
|
||||
// Menu Location.
|
||||
$menu_location = apply_filters( 'ocean_main_menu_location', 'main_menu' );
|
||||
|
||||
// Menu arguments.
|
||||
$menu_args = array(
|
||||
'theme_location' => $menu_location,
|
||||
'menu_class' => 'fs-dropdown-menu',
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
);
|
||||
|
||||
// Check if custom menu.
|
||||
if ( $menu = oceanwp_header_custom_menu() ) {
|
||||
$menu_args['menu'] = $menu;
|
||||
}
|
||||
|
||||
// Left menu for the Center header style.
|
||||
$left_menu = get_theme_mod( 'ocean_center_header_left_menu' );
|
||||
$left_menu = '0' !== $left_menu ? $left_menu : '';
|
||||
$left_menu = apply_filters( 'ocean_center_header_left_menu', $left_menu );
|
||||
|
||||
// Menu arguments.
|
||||
$left_menu_args = array(
|
||||
'menu' => $left_menu,
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
);
|
||||
|
||||
// Top bar menu Location.
|
||||
$top_menu_location = 'topbar_menu';
|
||||
|
||||
// Menu arguments.
|
||||
$top_menu_args = array(
|
||||
'theme_location' => $top_menu_location,
|
||||
'menu_class' => 'fs-dropdown-menu',
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<div id="mobile-fullscreen" class="clr" <?php echo $fullscreen_menu_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
|
||||
<div id="mobile-fullscreen-inner" class="clr">
|
||||
|
||||
<a href="javascript:void(0)" class="close" aria-label="<?php esc_attr_e( 'Close Menu', 'oceanwp' ); ?>" <?php echo $fs_menu_close_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
|
||||
<div class="close-icon-wrap">
|
||||
<div class="close-icon-inner"></div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<nav class="<?php echo esc_attr( $classes ); ?>"<?php oceanwp_schema_markup( 'site_navigation' ); ?> role="navigation">
|
||||
|
||||
<?php
|
||||
// If has mobile menu.
|
||||
if ( has_nav_menu( 'mobile_menu' ) ) {
|
||||
get_template_part( 'partials/mobile/mobile-nav' );
|
||||
} else {
|
||||
|
||||
// If has center header style and left menu.
|
||||
if ( 'center' === oceanwp_header_style()
|
||||
&& $left_menu ) {
|
||||
wp_nav_menu( $left_menu_args );
|
||||
}
|
||||
|
||||
// Navigation.
|
||||
wp_nav_menu( $menu_args );
|
||||
|
||||
// If has top bar menu.
|
||||
if ( has_nav_menu( $top_menu_location ) ) {
|
||||
wp_nav_menu( $top_menu_args );
|
||||
}
|
||||
}
|
||||
|
||||
// Mobile search form.
|
||||
if ( get_theme_mod( 'ocean_mobile_menu_search', true ) ) {
|
||||
get_template_part( 'partials/mobile/mobile-fullscreen-search' );
|
||||
}
|
||||
|
||||
// Social.
|
||||
if ( true === get_theme_mod( 'ocean_menu_social', false ) ) {
|
||||
get_template_part( 'partials/header/social' );
|
||||
}
|
||||
?>
|
||||
|
||||
</nav>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
/**
|
||||
* Mobile Menu icon
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Retunr if disabled.
|
||||
if ( ! oceanwp_display_navigation() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Menu Location.
|
||||
$menu_location = apply_filters( 'ocean_main_menu_location', 'main_menu' );
|
||||
|
||||
// Multisite global menu.
|
||||
$ms_global_menu = apply_filters( 'ocean_ms_global_menu', false );
|
||||
|
||||
// Menu data attributes.
|
||||
$toggle_menu_attrs = apply_filters( 'oceanwp_menu_toggle_data_attrs', '' );
|
||||
|
||||
// Display if menu is defined.
|
||||
if ( has_nav_menu( $menu_location ) || $ms_global_menu ) :
|
||||
|
||||
// Get menu icon.
|
||||
$icon = get_theme_mod( 'ocean_mobile_menu_open_icon', 'fa fa-bars' );
|
||||
$icon = apply_filters( 'ocean_mobile_menu_navbar_open_icon', $icon );
|
||||
|
||||
// Custom hamburger button.
|
||||
$btn = get_theme_mod( 'ocean_mobile_menu_open_hamburger', 'default' );
|
||||
|
||||
// Get menu text.
|
||||
$text = get_theme_mod( 'ocean_mobile_menu_text' );
|
||||
$text = oceanwp_tm_translation( 'ocean_mobile_menu_text', $text );
|
||||
$text = $text ? $text : esc_html__( 'Menu', 'oceanwp' );
|
||||
|
||||
// Get close menu text.
|
||||
$close_text = get_theme_mod( 'ocean_mobile_menu_close_text' );
|
||||
$close_text = oceanwp_tm_translation( 'ocean_mobile_menu_close_text', $close_text );
|
||||
$close_text = $close_text ? $close_text : esc_html__( 'Close', 'oceanwp' );
|
||||
|
||||
if ( OCEANWP_WOOCOMMERCE_ACTIVE ) {
|
||||
|
||||
// Get cart icon.
|
||||
$woo_icon = get_theme_mod( 'ocean_woo_menu_icon', 'icon-handbag' );
|
||||
$woo_icon = $woo_icon ? $woo_icon : 'icon-handbag';
|
||||
|
||||
// If has custom cart icon.
|
||||
$custom_icon = get_theme_mod( 'ocean_woo_menu_custom_icon' );
|
||||
if ( '' !== $custom_icon ) {
|
||||
$woo_icon = $custom_icon;
|
||||
}
|
||||
|
||||
// Cart Icon.
|
||||
$cart_icon = '<i class="' . esc_attr( $woo_icon ) . '" aria-hidden="true"></i>';
|
||||
$cart_icon = apply_filters( 'ocean_menu_cart_icon_html', $cart_icon );
|
||||
|
||||
}
|
||||
|
||||
// Classes.
|
||||
$classes = array( 'oceanwp-mobile-menu-icon', 'clr' );
|
||||
|
||||
// Position.
|
||||
if ( 'three' === get_theme_mod( 'ocean_mobile_elements_positioning', 'one' ) ) {
|
||||
$classes[] = 'mobile-left';
|
||||
} else {
|
||||
$classes[] = 'mobile-right';
|
||||
}
|
||||
|
||||
// Turn classes into space seperated string.
|
||||
$classes = implode( ' ', $classes ); ?>
|
||||
|
||||
<div class="<?php echo esc_attr( $classes ); ?>">
|
||||
|
||||
<?php do_action( 'ocean_before_mobile_icon' ); ?>
|
||||
|
||||
<?php
|
||||
// If big header style.
|
||||
if ( 'big' === oceanwp_header_style() ) {
|
||||
?>
|
||||
<div class="container clr">
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php do_action( 'ocean_before_mobile_icon_inner' ); ?>
|
||||
|
||||
<a href="javascript:void(0)" class="mobile-menu" <?php echo $toggle_menu_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> aria-label="<?php esc_attr_e( 'Mobile Menu', 'oceanwp' ); ?>">
|
||||
<?php
|
||||
if ( 'default' !== $btn ) {
|
||||
?>
|
||||
<div class="hamburger hamburger--<?php echo esc_attr( $btn ); ?>" aria-expanded="false">
|
||||
<div class="hamburger-box">
|
||||
<div class="hamburger-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<i class="<?php echo esc_attr( $icon ); ?>" aria-hidden="true"></i>
|
||||
<?php
|
||||
}
|
||||
|
||||
// Mobile menu text.
|
||||
if ( get_theme_mod( 'ocean_mobile_menu_display_opening_text', true ) ) {
|
||||
?>
|
||||
<span class="oceanwp-text"><?php echo do_shortcode( $text ); ?></span>
|
||||
<span class="oceanwp-close-text"><?php echo do_shortcode( $close_text ); ?></span>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
|
||||
<?php do_action( 'ocean_after_mobile_icon_inner' ); ?>
|
||||
|
||||
<?php
|
||||
// If big header style.
|
||||
if ( 'big' === oceanwp_header_style() ) {
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php do_action( 'ocean_after_mobile_icon' ); ?>
|
||||
|
||||
</div><!-- #oceanwp-mobile-menu-navbar -->
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Mobile nav template part.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Menu Location.
|
||||
$menu_location = apply_filters( 'ocean_mobile_menu_location', 'mobile_menu' );
|
||||
|
||||
// Menu arguments.
|
||||
$menu_args = array(
|
||||
'theme_location' => $menu_location,
|
||||
'container' => false,
|
||||
'fallback_cb' => false,
|
||||
);
|
||||
|
||||
// If sidebar mobile menu style.
|
||||
if ( 'sidebar' === oceanwp_mobile_menu_style() ) {
|
||||
$menu_args['menu_class'] = 'mobile-menu dropdown-menu';
|
||||
}
|
||||
|
||||
// Display menu if defined.
|
||||
if ( has_nav_menu( $menu_location ) ) : ?>
|
||||
|
||||
<div id="mobile-nav" class="navigation clr">
|
||||
|
||||
<?php
|
||||
|
||||
// Display menu.
|
||||
wp_nav_menu( $menu_args );
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Mobile search template.
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Post type.
|
||||
$post_type = get_theme_mod( 'ocean_menu_search_source', 'any' );
|
||||
|
||||
$ocean_msf_id = oceanwp_unique_id( 'ocean-mobile-search' );
|
||||
$mosf_id = esc_attr( $ocean_msf_id );
|
||||
|
||||
?>
|
||||
|
||||
<div id="mobile-menu-search" class="clr">
|
||||
<form method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" class="mobile-searchform" role="search" aria-label="<?php esc_attr_e( 'Search for:', 'oceanwp' ); ?>">
|
||||
<label for="<?php echo esc_attr( $mosf_id ); ?>">
|
||||
<input type="search" name="s" autocomplete="off" placeholder="<?php oceanwp_theme_strings( 'owp-string-mobile-search-text', 'oceanwp' ); ?>" />
|
||||
<button type="submit" class="searchform-submit" aria-label="<?php esc_attr_e( 'Submit Search', 'oceanwp' ); ?>">
|
||||
<i class="icon icon-magnifier" aria-hidden="true"></i>
|
||||
</button>
|
||||
<?php if ( 'any' !== $post_type ) { ?>
|
||||
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>">
|
||||
<?php } ?>
|
||||
</label>
|
||||
<?php do_action( 'wpml_add_language_form_field' ); ?>
|
||||
</form>
|
||||
</div><!-- .mobile-menu-search -->
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Mobile Menu sidr close
|
||||
*
|
||||
* @package OceanWP WordPress theme
|
||||
*/
|
||||
|
||||
// Exit if accessed directly.
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// Get icon.
|
||||
$icon = get_theme_mod( 'ocean_mobile_menu_close_btn_icon', 'icon-close' );
|
||||
$icon = apply_filters( 'ocean_mobile_menu_close_btn_icon', $icon );
|
||||
|
||||
// Text.
|
||||
$text = get_theme_mod( 'ocean_mobile_menu_close_btn_text' );
|
||||
$text = oceanwp_tm_translation( 'ocean_mobile_menu_close_btn_text', $text );
|
||||
$text = $text ? $text : esc_html__( 'Close Menu', 'oceanwp' );
|
||||
|
||||
?>
|
||||
|
||||
<div id="sidr-close">
|
||||
<a href="javascript:void(0)" class="toggle-sidr-close" aria-label="<?php esc_attr_e( 'Close mobile Menu', 'oceanwp' ); ?>">
|
||||
<i class="icon <?php echo esc_attr( $icon ); ?>" aria-hidden="true"></i><span class="close-text"><?php echo do_shortcode( $text ); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
Reference in New Issue
Block a user