Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function catchbox_main_header_image_position() {
- // Getting data from Theme Options
- $options = catchbox_get_options();
- $position = $options['header_image_position'];
- if ( 'above' == $position ) {
- add_action( 'catchbox_child_after_primary_menu', 'catchbox_main_header_image', 10 );
- }
- elseif ( 'below' == $position ) {
- add_action( 'catchbox_after_headercontent', 'catchbox_main_header_image', 10 );
- }
- }
- function catchbox_header_menu() {
- //Getting Ready to load options data
- $options = catchbox_get_options();
- $classes = "mobile-menu-anchor page-menu";
- // Header Left Mobile Menu Anchor
- if ( has_nav_menu( 'primary' ) ) {
- $classes = "mobile-menu-anchor primary-menu";
- }
- ?>
- <div class="menu-access-wrap mobile-header-menu clearfix">
- <?php if ( empty ($options['disable_responsive'] ) ) { ?>
- <div id="mobile-header-left-menu" class="<?php echo $classes; ?>">
- <?php
- $hide_mobile_menu_labels = isset( $options['hide_mobile_menu_labels'] ) ? $options['hide_mobile_menu_labels'] : 0;
- $label = isset( $options['primary_mobile_menu_label'] ) ? $options['primary_mobile_menu_label'] : esc_html__( 'Menu', 'catch-box-pro' );
- $labelclass = "mobile-menu-text";
- if ( !empty ( $hide_mobile_menu_labels ) ) {
- $labelclass = "screen-reader-text";
- }
- ?>
- <a href="#mobile-header-left-nav" id="menu-toggle-primary" class="genericon genericon-menu">
- <span class="<?php echo esc_attr( $labelclass ); ?>"><?php echo esc_attr( $label ); ?></span>
- </a>
- </div><!-- #mobile-header-left-menu -->
- <?php
- if ( !empty ($options['enable_sec_menu'] ) && has_nav_menu( 'secondary', 'catch-box-pro' ) ) :
- $menuclass = "mobile-enable"; ?>
- <div id="mobile-header-right-menu" class="mobile-menu-anchor secondary-menu">
- <?php
- $hide_mobile_menu_labels = isset( $options['hide_mobile_menu_labels'] ) ? $options['hide_mobile_menu_labels'] : 0;
- $label = isset( $options['secondary_mobile_menu_label'] ) ? $options['secondary_mobile_menu_label'] : esc_html__( 'Secondary Menu', 'catch-box-pro' );
- $labelclass = "mobile-menu-text";
- if ( !empty ( $hide_mobile_menu_labels ) ) {
- $labelclass = "screen-reader-text";
- }
- ?>
- <a href="#mobile-header-right-nav" id="menu-toggle-secondary" class="genericon genericon-menu">
- <span class="<?php echo $labelclass; ?>"><?php echo esc_attr( $label ); ?></span>
- </a>
- </div><!-- #mobile-header-right-menu -->
- <?php else :
- $menuclass = "mobile-disable";
- endif; ?>
- <?php } ?>
- <div id="site-header-menu-primary" class="site-header-menu">
- <nav id="access" class="main-navigation menu-focus" role="navigation" aria-label="<?php esc_attr_e( 'Primary Menu', 'catch-box-pro' ); ?>">
- <h3 class="screen-reader-text"><?php _e( 'Primary menu', 'catch-box-pro' ); ?></h3>
- <?php
- if ( has_nav_menu( 'primary', 'catch-box-pro' ) ) {
- $args = array(
- 'theme_location' => 'primary',
- 'container_class' => 'menu-header-container',
- 'items_wrap' => '<ul class="menu">%3$s</ul>'
- );
- wp_nav_menu( $args );
- }
- else {
- echo '<div class="menu-header-container">';
- wp_page_menu( array( 'menu_class' => 'menu' ) );
- echo '</div>';
- }
- ?>
- </nav><!-- #access -->
- </div><!-- .site-header-menu -->
- <?php do_action( 'catchbox_child_after_primary_menu' ); ?>
- <?php if ( has_nav_menu( 'secondary' ) ) { ?>
- <div id="site-header-menu-secondary" class="site-header-menu">
- <nav id="access-secondary" class="<?php echo $menuclass; ?>" role="navigation" aria-label="<?php esc_attr_e( 'Secondary Menu', 'catch-box-pro' ); ?>">
- <h3 class="screen-reader-text"><?php _e( 'Secondary menu', 'catch-box-pro' ); ?></h3>
- <?php wp_nav_menu( array( 'theme_location' => 'secondary', 'container_class' => 'menu-secondary-container' ) ); ?>
- </nav><!-- #access-secondary -->
- </div><!-- .site-header-menu -->
- <?php } ?>
- </div><!-- .menu-access-wrap -->
- <?php
- }
- function catchbox_child_remove_header_action(){
- remove_action( 'catchbox_before_headercontent', 'catchbox_main_header_image', 10 );
- }
- add_action( 'init', 'catchbox_child_remove_header_action' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement