Custom navigation
In version 1.3 of the Structure theme, the navigation files are gone and there’s a much different way of handling the customization of our page links in the header.
To edit your navigation, you need only add a function or two to your child theme’s functions.php file. If you’re unsure about what I’m talking about when it comes to child themes, you need only to step over to the support forums and take a look at a few of the sticky posts. There’s also documentation on modifying the theme correctly.
Custom page navigation
You need to read how the wp_list_pages() function works from the WordPress Codex. It will allow you to customize which pages, the order, and how many other things are displayed.
We need to write a simple function to overwrite the default. Here’s an example with a “Home” link added (remember, this goes in your child theme’s functions.php file):
<?php
function my_custom_nav() {
?>
<ul id="nav">
<li class="page_item<?php if(is_home()) { echo ' current_page_item'; } ?>"><a href="<?php bloginfo('url'); ?>" title="Home">Home</a></li>
<?php wp_list_pages('title_li=&depth=3&sort_column=menu_order'); ?>
</ul>
<?php
}
Then, we need to filter the original function:
add_filter( 'op_page_nav', 'my_custom_nav' ); ?>
That’s all you need to do. Pretty simple, right?
Moving the navigation below the header
So, maybe you want to move the navigation below the header instead of having it above.
In your child theme’s functions.php file, add this:
<?php
// Add function to header
add_action('wp_head','my_replace_nav');
/*
* my_replace_nav()
*/
function my_replace_nav() {
remove_action('op_before_header','op_page_nav');
add_action('op_after_header','op_page_nav');
}
?>
This just tells WordPress to move our header to a different area using WordPress hooks.