ThemeShaper Forums » Thematic

[closed]

Skip link showing up multiple times in my custom nav.

(6 posts)
  • Started 2 years ago by siguy
  • Latest reply from siguy
  • This topic is resolved
  1. Hey Guys, I would first of all like to say thank you VERY much for such an awesome theme framework. I think I will be using it exclusively from now on! (as much as is possible)

    Now, I've been working on a new site for a client and following the guides posted that uses

    add_action('init','remove_thematic_actions');

    to remove the standard nav and

    add_action('thematic_header','custom_childtheme_access',9);

    to add your own. (I'll add the full function below) The problem I am having is that the skip link is being added three times instead of once before the nav menu:

    <div id="access">
    	<div class="skip-link"><a href="#content" title="Skip navigation to the content">Skip to content</a></div><a href="#content" title="Skip navigation to the content">
    	</a><div class="menu"><a href="#content" title="Skip navigation to the content">
    		</a><ul class="menu"><a href="#content" title="Skip navigation to the content">
    			</a><li class="menu-item menu-item-1"><a href="#content" title="Skip navigation to the content"></a><a href="#">About</a></li>
    			<li class="menu-item menu-item-2"><a href="#">Beauty</a></li>

    ... etc ...

    here's my code and a link to the site: http://new.eccotique.com/

    function custom_childtheme_access(){?>
    	<div id="access">
    	<div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content','thematic-child');?>"><?php _e('Skip to content','thematic-child');?></div>
    	<div class="menu">
    		<ul class="menu">
    			<li class="menu-item menu-item-1"><a href="#">About</a></li>
    			<li class="menu-item menu-item-2"><a href="#">Beauty</a></li>
    			<li class="menu-item menu-item-3"><a href="#">Contact</a></li>
    			<li class="menu-item menu-item-4"><a href="#">Hair</a></li>
    			<li class="menu-item menu-item-5"><a href="#">Services</a></li>
    			<li class="menu-item menu-item-6"><a href="#">What's Happening</a></li>
    			<li class="menu-item menu-item-7"><a href="#">Your Ideas</a></li>
    		</ul>
    	</div><!-- #menu -->
    	</div><!-- #access --> 
    
    <?php }
    
    add_action('thematic_header','custom_childtheme_access',9);

    Any help would be greatly appreciated. I'm a novice coder (I usually don't write my own software but I often customize other people's to do work the way I need it to) and I really can't see what would be causing this to happen.

    Cheers!

    Posted 2 years ago #
  2. Without looking too hard, it looks like you forgot a closing </a> tag. That would be a start. ;)

    Posted 2 years ago #
  3. agree w/ scott. you don't seem to be closing your skip link.

    also, assuming you are using thematic 0.9.8 you can just write:

    function childtheme_override_access(){?>
    	<div id="access">
    	<div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content','thematic-child');?>"><?php _e('Skip to content','thematic-child');?></a></div>
    	<div class="menu">
    		<ul class="menu">
    			<li class="menu-item menu-item-1"><a href="#">About</a></li>
    			<li class="menu-item menu-item-2"><a href="#">Beauty</a></li>
    			<li class="menu-item menu-item-3"><a href="#">Contact</a></li>
    			<li class="menu-item menu-item-4"><a href="#">Hair</a></li>
    			<li class="menu-item menu-item-5"><a href="#">Services</a></li>
    			<li class="menu-item menu-item-6"><a href="#">What's Happening</a></li>
    			<li class="menu-item menu-item-7"><a href="#">Your Ideas</a></li>
    		</ul>
    	</div><!-- #menu -->
    	</div><!-- #access --> 
    
    <?php }

    without the add_actions and remove_actions. why would you hard code this instead of create it w/ the WP3.0 custom menu?

    Posted 2 years ago #
  4. I was copying and pasting code directly from step 9. of: http://forums.themeshaper.com/topic/thematic-menus-demystified-1 I looked for any issues but I can see that I didn't really look hard enough! I just needed a second (and third) pair of eyes to help me out.

    Thanks helgatheviking for pointing out the more efficient way of setting up a custom menu :)

    Posted 2 years ago #
  5. well my forum post sort of pre-dates the overrides. bad thing about a forum is that you can't go back and edit... though i guess i can now thanks to my new mod powers. why i've always wanted a wiki.

    still the point of rolling your own hard-coded menu was if you were creating something crazy complex that you just couldn't recreate w/ the default system. you seem to be just re-creating what WP can already do and thereby actually removing functionality and locking yourself into this menu for all eternity. exaggeration, but you won't be able to modify it ever from the dashboard like you could if you didn't override access and created a menu in WP. you'll ways need to edit code to edit the menu and unless you go back and add dynamic classes, you'll never be able to create the "i'm here" style changes that let people know where they are in the site.

    even if you only want the # anchor link you can do that from WP

    Posted 2 years ago #
  6. It might be a good thing to update that post or maybe make some kind of follow up with a correction for that missing tag at least.

    After some looking around it seemed that the easiest and cleanest way to do an image based nav was to use that custom nav function, but after reading your response it does seem like it would not be that difficult to use the standard nav and simply use css to add the images and size/position it all corectly. I'm pretty sure the nav is never going to change (unless it's an image change to re-word things slightly) also, that's the kind of thing that would probably have to be up to me anyways as the client doesn't have the know-how to get that kind of thing done.

    The "I'm here" bit is something I might miss though. I guess I have a decision to make!

    Thank you all for the helpful responses!!

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.