Skip to content

Instantly share code, notes, and snippets.

@brentini
Forked from reneeHS/header.php
Last active March 23, 2018 21:33
Show Gist options
  • Select an option

  • Save brentini/fcf2eb343a54c1ebc2b4e315fa3970c1 to your computer and use it in GitHub Desktop.

Select an option

Save brentini/fcf2eb343a54c1ebc2b4e315fa3970c1 to your computer and use it in GitHub Desktop.
header.php for Wordpress #wordpress
<?php
/**
* Flatbase by NiceThemes.
*
* The Header for our theme.
*
* Displays all of the `<head>` section and everything up till `<div id="container">`
*
* @package Flatbase
* @author NiceThemes <[email protected]>
* @license GPL-2.0+
* @link http://nicethemes.com/theme/flatbase
* @copyright 2016 NiceThemes
* @since 1.0.0
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
global $nice_options;
?>
<!DOCTYPE html>
<!--[if IE 7]> <html class="ie ie7" <?php language_attributes(); ?> prefix="og: http://ogp.me/ns#"> <![endif]-->
<!--[if IE 8]> <html class="ie ie8" <?php language_attributes(); ?> prefix="og: http://ogp.me/ns#"> <![endif]-->
<!--[if IE 9]> <html class="ie ie9" <?php language_attributes(); ?> prefix="og: http://ogp.me/ns#"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html <?php language_attributes(); ?> prefix="og: http://ogp.me/ns#">
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php wp_title( '&laquo;', true, 'right' ); ?> <?php bloginfo( 'name' ); ?></title>
<!-- Pingback -->
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<!-- BEGIN #wrapper -->
<div id="wrapper">
<!-- BEGIN #header -->
<header id="header" class="clearfix">
<!-- BEGIN #top -->
<div id="top" class="col-full">
<!-- BEGIN #logo -->
<?php
$class = ( is_rtl() ? 'fr' : 'fl' );
nice_logo( array( 'before' => '<div id="logo" class="' . $class . '">',
'after' => '</div>'
) ); ?>
<!-- END #logo -->
<a href="#" id="toggle-nav"><i class="fa fa-bars"></i></a>
<!-- BEGIN #navigation -->
<nav id="navigation">
<?php $defaults = array(
'menu' => '',
'container' => 'div',
'container_class' => '',
'container_id' => '',
'menu_class' => is_rtl() ? 'nav fl clearfix' : 'nav fr clearfix',
'menu_id' => 'main-nav',
'echo' => true,
'fallback_cb' => '',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'depth' => 0,
'walker' => new Nice_Walker_Nav_Menu(),
'theme_location' => 'navigation-menu' );
wp_nav_menu( $defaults ); ?>
<!-- END #navigation -->
</nav>
<!-- END #top -->
</div>
<?php
$nice_livesearch_enable = get_option( 'nice_livesearch_enable' );
<!-- #live-search -->
<section id="live-search" class="clearfix">
<div class="container col-full">
<?php
$nice_welcome_message = get_option( 'nice_welcome_message' );
$nice_welcome_message_extended = get_option( 'nice_welcome_message_extended' );
if ( ( $nice_welcome_message != '' ) || ( $nice_welcome_message_extended != '' ) && is_front_page() && nice_bool( $nice_livesearch_enable ) && ( is_front_page() || is_page_template( 'template-home.php' ) ) ) : ?>
<!-- THIS ISN'T WORKING - work on revising this -->
<!-- BEGIN .welcome-message -->
<section class="welcome-message clearfix">
<div class="col-full">
<?php if ( $nice_welcome_message != '' ) : ?>
<header>
<h2><?php echo stripslashes( htmlspecialchars_decode( nl2br( $nice_welcome_message ) ) ); ?></h2>
</header>
<?php endif ;?>
<?php if ( $nice_welcome_message_extended != '' ) : ?>
<p><?php echo stripslashes( htmlspecialchars_decode( nl2br( $nice_welcome_message_extended ) ) ); ?></p>
<?php endif ;?>
</div>
<!-- END .welcome-message -->
</section>
<?php endif; ?>
<div id="search-wrap">
<form role="search" method="get" id="searchform" class="clearfix" action="<?php echo home_url( '/' ); ?>" autocomplete="off">
<div class="input">
<label for="s"><?php echo apply_filters( 'nice_livesearch_label', __( 'Have a question? Ask or enter a search term.', 'nicethemes' ) ); ?></label>
<input type="text" name="s" id="s" />
<input type="submit" id="searchsubmit" value="&#xf002;" />
</div>
</form>
</div>
</div>
</section>
<!-- /#live-search -->
<!-- END #header -->
</header>
<?php if ( ! is_page_template( 'template-home.php' ) ) : ?>
<!-- BEGIN #container -->
<div id="container" class="clearfix">
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment