Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
startet work with large header
Browse files Browse the repository at this point in the history
  • Loading branch information
losolio committed Aug 1, 2017
1 parent c0baba1 commit 2d91de3
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
@@ -0,0 +1,12 @@
# Files to exclude when creating archive.

*.git export-ignore
*.github export-ignore
*.gitignore export-ignore
*.gitattributes export-ignore
.jscsrc export-ignore
.jshintignore export-ignore
.travis.yml export-ignore
CONTRIBUTING.md export-ignore
CONTRIBUTORS.md export-ignore
codesniffer.ruleset.xml export-ignore
8 changes: 8 additions & 0 deletions .jscsrc
@@ -0,0 +1,8 @@
{
"preset": "wordpress",
"fileExtensions": [ ".js" ],
"excludeFiles": [
"assets/js/html5.js",
"assets/js/jquery.scrollTo.js"
]
}
2 changes: 2 additions & 0 deletions .jshintignore
@@ -0,0 +1,2 @@
assets/js/html5.js
assets/js/jquery.scrollTo.js
69 changes: 69 additions & 0 deletions components/header/header-large.php
@@ -0,0 +1,69 @@
<?php
/**
* The navigation meny usually placed in the header.
*
* @package Positor
*/

?>

<?php
// Checks if the navbar should be hidden for this post/page.
$hide_navbar = false;
if ( is_single() || is_page() ) {
$hide_navbar = get_post_meta( get_the_ID(), '_positor_hide_navbar', true );
}

if ( ! $hide_navbar ) { ?>

<nav id="site-navigation" class="navbar navbar-toggleable-sm navbar-inverse bg-primary link-no-decoration">
<div class="hidden-sm-down">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="pull-xs-left"><?php positor_the_custom_logo(); ?></a>
</div>

<button class="btn btn-link d-flex align-middle nav-item pull-left text-white text-uppercase hidden-md-up" type="button" data-toggle="collapse" data-target="#navbar-menu" aria-controls="bs4navbar" aria-expanded="false" aria-label="Toggle navigation">
<i class="fa fa-fw fa-1_2x fa-bars" aria-hidden="true"></i>&nbsp;<span><?php esc_html_e( 'Menu', 'positor' ); ?></span>
</button>

<button class="btn btn-link nav-item pull-right navbar-toggler-right text-uppercase text-white text-nowrap" type="button" data-toggle="collapse" data-target="#searchform" aria-controls="searchform" aria-expanded="false" aria-label="Toggle navigation">
<i class="fa fa-fw fa-1_2x fa-search" aria-hidden="true"></i>&nbsp;<?php esc_html_e( 'Search', 'positor' ); ?>
</button>


<a id="site-title" class="navbar-brand px-1 hidden-sm-down site-title" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a>
<?php

wp_nav_menu( array(
'menu' => 'top',
'theme_location' => 'menu-1',
'container' => 'div',
'container_id' => 'navbar-menu',
'container_class' => 'collapse navbar-collapse',
'menu_id' => 'top_menu',
'menu_class' => 'navbar-nav mr-auto',
'depth' => 2,
'walker' => new Bootstrap_Nav_Walker(),
'fallback_cb' => 'Bootstrap_Nav_Walker::fallback',
)
);

?>

</nav>
<div id="searchform" class="container-fluid collapse">
<div class="row bg-gray-800">
<div class="container p-4 w-100">
<form role="search" method="get" class="form search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<div class="input-group">
<input name="s" type="text" class="form-control" placeholder="<?php esc_html_e( 'What are you searching for?', 'positor' ); ?>">
<span class="input-group-btn">
<button type="submit" value="Search" class="btn btn-danger"><i class="fa fa-search" aria-hidden="true"></i>&nbsp;</button>
</span>
</div>
</form>
</div>
</div>
</div>
<?php
} // End if().
?>
1 change: 1 addition & 0 deletions docs/adding_travis.md
Expand Up @@ -4,6 +4,7 @@
2. Enable your repository to Travis.
3. Add a Travis file to your repository. https://github.com/WordPress/twentyseventeen/blob/master/.travis.yml. Add this to your themes root folder.
4. In .travis.yml change the PHP Codesniffer version to 2.9.1 by editing to: https://github.com/squizlabs/PHP_CodeSniffer/archive/2.9.1.tar.gz
5. Add .jscsrc and .jshintignore, sample files in Twenty Seventeen.
4. Push to update the repository. Travis will only run builds after it is enabled.

2. Add a ruleset for automatic sniffing: https://github.com/WordPress/twentyseventeen/blob/master/codesniffer.ruleset.xml
Expand Down

0 comments on commit 2d91de3

Please sign in to comment.