Skip to content

Instantly share code, notes, and snippets.

@partageit
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save partageit/8d163662596d814e8062 to your computer and use it in GitHub Desktop.
Save partageit/8d163662596d814e8062 to your computer and use it in GitHub Desktop.
Partage-it.com : Header du template monopage pour Twenty Thirteen
<?php
/**
* En-tête du template mono page pour Twenty Thirteen
* Copié du header.php et modifié pour un thème enfant
*/
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width">
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?> data-spy="scroll" data-target="#scrollspyMenu" data-offset="100">
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<a class="home-link" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</a>
<?php
$page = get_queried_object();
global $the_content;
$the_content = $page->post_content;
$the_content = apply_filters("the_content", $the_content );
$newResult = setIdToTags($the_content);
$h2s = $newResult["ids"];
$the_content = $newResult["result"];
?>
<div id="navbar" class="navbar" data-spy="affix" data-offset-top="175">
<nav id="site-navigation" class="navigation main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3>
<a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a>
<div class="nav-menu" id="scrollspyMenu">
<ul class="nav">
<li>
<a href="../">Accueil</a>
</li>
<?php
foreach ($h2s as $id => $title) {
?>
<li>
<a href="#<?php echo $id; ?>"><?php echo $title; ?></a>
</li>
<?php
}
?>
</ul>
</div>
</nav><!-- #site-navigation -->
</div><!-- #navbar -->
</header><!-- #masthead -->
<div id="main" class="site-main">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment