Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release/register_nav_menu'

  • Loading branch information...
commit 59edd0d5c5ad0c5973f9316b964ecc14084c5866 2 parents 3eba73a + bacafad
@grayghostvisuals authored
Showing with 35 additions and 39 deletions.
  1. +30 −32 functions.php
  2. +5 −7 header.php
View
62 functions.php
@@ -1,5 +1,5 @@
-<?php
-/*------------------------------------------------------------------------------------------------[ custom image header constraints ] */
+<?php
+/*-----------------------------------[ custom image header constraints ] */
//Custom Image Header Constants
define( 'HEADER_TEXTCOLOR', '' );
@@ -8,38 +8,36 @@
define( 'HEADER_IMAGE_HEIGHT', 200 );
-/*------------------------------------------------------------------------------------------------[ after setup theme init ] */
-
-
-//themename custom function setup
-add_action( 'after_setup_theme', 'wpflex_setup' );
-
-
-/*------------------------------------------------------------------------------------------------[ theme options ] */
-
+/*-----------------------------------[ theme options ] */
//wpflex options
include_once( get_template_directory() . '/wpflex-options.php' );
-/*------------------------------------------------------------------------------------------------[ theme setup function ] */
-
+/*-----------------------------------------------------------------------[ theme setup function ] */
//if ! wpflex_setup
if ( ! function_exists( 'wpflex_setup' ) ) :
+
//wpflex_setup
function wpflex_setup() {
-/*------------------------------------------------------------------------------------------------[ wp enque script ] */
+/*-----------------------------------[ register the custom nav menus ] */
+
+register_nav_menus( array(
+ 'primary' => 'Primary Menu'
+));
-if ( is_singular() ) :
-wp_enqueue_script( 'comment-reply' );
+/*-----------------------------------[ wp enque script ] */
+
+if ( is_singular() ) :
+ wp_enqueue_script( 'comment-reply' );
endif;
-/*------------------------------------------------------------------------------------------------[ custom theme header ] */
+/*-----------------------------------[ custom theme header ] */
// http://codex.wordpress.org/Custom_Headers
// http://codex.wordpress.org/Appearance_Header_Screen
@@ -63,31 +61,27 @@ function wpflex_setup() {
add_theme_support( 'custom-header', $custom_header_defaults );
-/*------------------------------------------------------------------------------------------------[ rss feed ] */
-
+/*-----------------------------------[ rss feed ] */
// enables post and comment RSS feed links to head
// required for theme submission
add_theme_support( 'automatic-feed-links' );
-/*------------------------------------------------------------------------------------------------[ editor style sheet ] */
-
+/*-----------------------------------[ editor style sheet ] */
//add editor style sheet
add_editor_style();
-/*------------------------------------------------------------------------------------------------[ custom background ] */
-
+/*-----------------------------------[ custom background ] */
// allows users to set a custom background
// add_theme_support( 'custom-background', $args )
add_theme_support( 'custom-background' );
-/*------------------------------------------------------------------------------------------------[ post thumbnails ] */
-
+/*-----------------------------------[ post thumbnails ] */
// enables post-thumbnail support
// enables for Posts and "movie" post type but not for Pages
@@ -97,8 +91,7 @@ function wpflex_setup() {
set_post_thumbnail_size( 700, 450, true );
-/*------------------------------------------------------------------------------------------------[ content width ] */
-
+/*-----------------------------------[ content width ] */
// if content_width not set
if ( ! isset( $content_width ) ) :
@@ -106,8 +99,7 @@ function wpflex_setup() {
endif;
-/*------------------------------------------------------------------------------------------------[ widgets ] */
-
+/*-----------------------------------[ widgets ] */
// wpflex widget setup
function wpflex_widget() {
@@ -121,7 +113,7 @@ function wpflex_widget() {
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
));// end primary sidebar
-
+
// call to register footer sidebar widgets
register_sidebar( array(
'ID' => 'fw',
@@ -136,9 +128,15 @@ function wpflex_widget() {
// trigger the wpflex widget function
// required for theme submission
-add_action( 'widgets_init' , 'wpflex_widget' );
+add_action( 'widgets_init' , 'wpflex_widget' );
}// end wpflex_setup
-endif;// end ! function_exists( 'wpflex_setup' )
+endif;// end ! function_exists( 'wpflex_setup' )
+
+
+/*-----------------------------------------------------------------------[ after setup theme init ] */
+
+//themename custom function setup
+add_action( 'after_setup_theme', 'wpflex_setup' );
View
12 header.php
@@ -126,11 +126,12 @@
<h2 class="tagline"><?php echo esc_attr( bloginfo( 'description' ) ); ?></h2>
<!-- http://codex.wordpress.org/Function_Reference/wp_nav_menu -->
+ <!-- http://codex.wordpress.org/Navigation_Menus -->
<nav role="navigation">
- <?php
- $nav_wpflex = array(
+ <?php wp_nav_menu( array(
+ 'theme_location' => 'primary',
'menu' => '',
- 'container' => 'div',
+ 'container' => 'menu-container',
'container_class' => 'menu-{menu slug}-container',
'container_id' => '',
'menu_class' => 'menu',
@@ -144,10 +145,7 @@
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'depth' => 0,
'walker' => ''
- );
-
- // call to naviagtion using our arguments
- wp_nav_menu( $nav_wpflex );
+ ));
?>
</nav>
</header>
Please sign in to comment.
Something went wrong with that request. Please try again.