Last active
December 21, 2015 15:39
-
-
Save agusmu/6328636 to your computer and use it in GitHub Desktop.
PrimaShop - Another Header Menu Customization
This file contains hidden or 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 | |
/** | |
* Custom template for displaying header content (logo and menu). | |
* | |
* @category PrimaShop | |
* @package Templates | |
* @author PrimaThemes | |
* @link http://www.primathemes.com | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
?> | |
<header id="header" class="group"> | |
<div class="margin group"> | |
<div id="header-title" class="group"> | |
<?php if ( !is_singular() || ( is_page() && prima_get_post_meta( '_page_title_hide' ) ) || is_page_template('page_blog.php') ) : ?> | |
<h1 class="site-title"> | |
<a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a> | |
</h1> | |
<?php else : ?> | |
<div class="site-title"> | |
<a href="<?php echo home_url(); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a> | |
</div> | |
<?php endif; ?> | |
<?php do_action( 'prima_header_left' ); ?> | |
</div> | |
</div> | |
<div id="header-menu" class="group"> | |
<div class="margin group"> | |
<?php wp_nav_menu( array( 'theme_location' => 'header-menu', 'fallback_cb' => '', 'echo' => true, 'container' => false, 'menu_id' => 'menu-primary', 'menu_class' => 'sf-menu menu-primary' ) ); ?> | |
<?php do_action( 'prima_header_right' ); ?> | |
</div> | |
</div> | |
</header> |
This file contains hidden or 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
/* reset floating of header title/logo and menu */ | |
#header-title, #header-menu { | |
clear: both; | |
float: none !important; | |
width: auto !important; | |
} | |
/* add background to header menu */ | |
#header-menu { | |
background: #DDDDDD; | |
} | |
/* toplevel menu padding: 15+20+15=50 */ | |
#header-menu .menu-primary a, #header-menu .menu-primary a:visited { | |
padding-top: 15px !important; | |
line-height: 20px !important; | |
padding-bottom: 15px !important; | |
} | |
/* submenu positioning */ | |
#header-menu .menu-primary li:hover ul, #header-menu .menu-primary li.sfHover ul { | |
top: 50px !important; | |
} | |
#header-menu .menu-primary li:hover ul ul, #header-menu .menu-primary li.sfHover ul ul { | |
top: 0px !important; | |
} |
This file contains hidden or 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
/* make left aligned header menu */ | |
#header-menu .menu-primary { | |
float: left; | |
} | |
#header-menu .menu-primary li { | |
padding-left: 0; | |
padding-right: 30px; | |
} | |
#header-menu .menu-primary li li li { | |
padding-left: 0; | |
padding-right: 0; | |
} |
This file contains hidden or 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
/* make centered aligned header menu */ | |
#header-title, | |
#header-title .site-title, | |
#header-title .site-title a { | |
float:none !important; | |
width:auto !important; | |
text-align: center; | |
background-position: center center !important; | |
} | |
#header-menu, | |
#header-menu .menu-primary { | |
float:none !important; | |
width:auto !important; | |
text-align: center; | |
} | |
#header-menu .menu-primary li { | |
padding: 0 10px; | |
float:none !important; | |
display: inline-block; | |
} | |
#header-menu .menu-primary li { | |
padding: 0; | |
float:left; | |
display: block; | |
} | |
#header-menu .menu-primary li li a, | |
#header-menu .menu-primary li li a:visited { | |
padding: 10px; | |
text-align: left; | |
} |
This file contains hidden or 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
@media only screen and (max-width: 1000px) { | |
#header-menu { | |
padding-top: 0 !important; | |
padding-bottom: 0 !important; | |
} | |
} | |
@media only screen and (max-width: 500px) { | |
#header-menu { | |
padding-top: 15px !important; | |
padding-bottom: 15px !important; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tutorial: http://www.primathemes.com/documentation/another-header-menu-customization/