ThemeShaper Forums » Thematic

[closed]

How to replace code in #access, but still keep the div

(7 posts)
  • Started 10 years ago by shelzmike
  • Latest reply from helgatheviking
  • This topic is resolved
  1. shelzmike
    Member

    Hello -

    I am probably being dense here as I am still learning php and where to find everything. That being said, I will try to be specific on what I am trying to do.

    I have added PixoPoint's multi-level navigation plug-in to my child theme based on thematic. I can get the menu to show up, but when I add the php code for the multi-level navigation menu, I do so in the header.php file. This keeps the old menu (that is in #access) and just puts the multi-level below it - thus 2 menus. I have found info on how to remove #access, but I do not really want to do that. I would rather simply replace the code [em]within[em] the access div. So where do I find that at? Or, if there is a simpler way (besides display:none in the css for #access), I would be grateful.

    Mike

    Posted 10 years ago #
  2. Hi Mike,

    use this code in your child theme's functions.php:

    // First we need to remove the action creating the menu
    function remove_access($content) {
    	remove_action('thematic_header','thematic_access',9);
    }
    add_action('init', 'remove_access');
    
    // Now we need to rebuild it
    function childtheme_access() { ?>
    		    	<div id="access">
    		    		<div class="skip-link"><a href="#content" title="<?php _e('Skip navigation to the content', 'thematic'); ?>"><?php _e('Skip to content', 'thematic'); ?></a></div>
    		            <!-- your code for the navigation menu -->
    		        </div><!-- #access -->
    		<?php }
    // add_action('thematic_header','childtheme_access',9);

    Chris

    Posted 10 years ago #
  3. shelzmike
    Member

    Hey Chris, thanks for the reply. Actually, I am as I mentioned in my original post, dense :). I did not realize that thematic already was using the sf-menu anyway. I do not need all that the menu I mentioned offers. What comes by default is plenty by me..all I needed to do was add certain pages as child pages and the menu did what I wanted it to (duh!). That being said, I did not try the code you posted, but coming from you, I am sure it probably does work (for anyone who may stumble upon this post who really does want to use the plug-in mentioned). Thanks again for the reply.

    Mike

    Posted 10 years ago #
  4. where is that function coming from? i looked in the thematic function file, and it looks rather sparse

    Posted 10 years ago #
  5. is there a way to do this conditionally Chris? I want to remove the menu on one page and keep the div

    Posted 9 years ago #
  6. i tried to modify your code with an if (is_page()) and I couldn't get it to work

    Posted 9 years ago #
  7. @ben - this thread discusses how to conditionally remove #access :

    http://forums.themeshaper.com/topic/conditionally-removing-thematic_access

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.