Created
January 21, 2016 18:22
-
-
Save anonymous/70e9f3e0dce77cecca6c to your computer and use it in GitHub Desktop.
functions.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Child Theme functions and definitions | |
* | |
*/ | |
/** | |
* Loading Parent theme stylesheet | |
* | |
*/ | |
add_action( 'wp_enqueue_scripts', 'catchbox_child_enqueue_styles' ); | |
function catchbox_child_enqueue_styles() { | |
wp_enqueue_style( 'catchbox-parent-style', get_template_directory_uri() . '/style.css' ); | |
} | |
/** | |
* Site branding | |
* | |
* @since WEN Business 1.0 | |
*/ | |
function wen_business_site_branding(){ | |
?> | |
<div id="site-navigation" role="navigation"> | |
<?php | |
wp_nav_menu( array( | |
'theme_location' => 'primary' , | |
'container' => 'nav' , | |
'container_class' => 'main-navigation' , | |
) | |
); | |
?> | |
</div> | |
<?php | |
} | |
/** | |
* Primary navigation | |
* | |
* @since WEN Business 1.0 | |
*/ | |
function wen_business_mobile_navigation(){ | |
?> | |
<a href="#mob-menu" id="mobile-trigger"><i class="fa fa-bars"></i></a> | |
<div style="display:none;"> | |
<div id="mob-menu"> | |
<?php | |
wp_nav_menu( array('theme_location' => 'primary','container' => "") );?> | |
</div> | |
</div> | |
<?php | |
} | |
/** | |
* Header top content | |
* | |
* @since WEN Business 1.0 | |
*/ | |
function wen_business_header_top_content(){ | |
$social_in_header = wen_business_get_option( 'social_in_header' ); | |
$search_in_header = wen_business_get_option( 'search_in_header' ); | |
?> | |
<?php if ( ( 1 == $social_in_header && wen_business_is_social_menu_active() ) || 1 == $search_in_header ): ?> | |
<div id="header-top-content"> | |
<div class="container"> | |
<div class="site-branding"> | |
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> | |
<?php | |
$site_logo = wen_business_get_option( 'site_logo' ); | |
?> | |
<?php if ( ! empty( $site_logo ) ): ?> | |
<img src="<?php echo esc_url( $site_logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" /> | |
<?php else: ?> | |
<?php bloginfo( 'name' ); ?> | |
<?php endif ?> | |
</a></h1> | |
<?php | |
$show_tagline = wen_business_get_option( 'show_tagline' ); | |
?> | |
<?php if ( 1 == $show_tagline ): ?> | |
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> | |
<?php endif ?> | |
</div> | |
<div class="header-top"> | |
<div class="header-top-inner"> | |
<?php if ( 1 == $social_in_header ): ?> | |
<?php the_widget( 'WEN_Business_Social_Widget', array( 'icon_size' => 'small' ) ); ?> | |
<?php endif ?> | |
<?php if ( 1 == $search_in_header ): ?> | |
<div id="header-search-form"> | |
<?php get_search_form(); ?> | |
</div> | |
<?php endif ?> | |
</div> | |
</div> | |
</div> | |
</div> | |
<?php endif; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment