Posted By

kristarella on 01/30/09


Tagged

php xhtml navigation thesiswp


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

girliegeek
tmbrenneke
joelhaus
naeemnur


Nav menu for Thesis


 / Published in: PHP
 

URL: http://diythemes.com/forums/thesis-customization-tips/2807-setting-nav-tab-order-thesis-1-3-3-a.html#post14551

An example of how to write your own navigation with dynamic "active" classes.

  1. function custom_nav_menu() {
  2. ?>
  3. <ul id="tabs">
  4. <li<?php if (is_home()) echo(' class="current_page_item"'); ?>><a href="<?php bloginfo('url'); ?>" rel="nofollow">home</a></li>
  5. <li<?php if (is_page('about-me')) echo(' class="current_page_item"'); ?>><a href="<?php bloginfo('url'); ?>/about/"<?php if (!is_home()) echo ' rel="nofollow"'; ?>>about</a></li>
  6. <li<?php if (is_page('contact-me')) echo(' class="current_page_item"'); ?>><a href="<?php bloginfo('url'); ?>/contact/"<?php if (!is_home()) echo ' rel="nofollow"'; ?>>contact</a></li>
  7. <?php if (thesis_get_option('show_feed_link')) {
  8. $feed_title = get_bloginfo('name') . ' RSS Feed';
  9. echo ' <li class="rss"><a href="' . thesis_feed_url() . '" title="' . $feed_title . '" rel="nofollow">' . thesis_feed_link_text() . '</a></li>' . "\n";
  10. } ?>
  11. </ul>
  12. <?php
  13. }
  14. remove_action('thesis_hook_before_header', 'thesis_nav_menu');
  15. add_action('thesis_hook_before_header', 'custom_nav_menu');

Report this snippet  

You need to login to post a comment.