ThemeShaper Forums » Thematic

How to move navigation with v.0.9

(11 posts)
  • Started 10 years ago by micahcooksey
  • Latest reply from Chris
  • This topic is resolved
  1. Hi, how would you go about removing the nav from within the header div to reside above the body or anywhere besides the default location for that matter? It's harder now because thematic simply auto-generates the whole header in one element.

    Thanks!

    Posted 10 years ago #
  2. I you're working in a Child Theme you can use

    // Remove default Thematic actions
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');

    in your functions.php to remove the menu and

    // Create #access
    // Somewhere else
    function childtheme_access() { ?>
        	<div id="access">
                 <!-- menu stuff -->
            </div><!-- #access -->
    <?php }
    add_action('thematic_something_or_other','childtheme_access');

    to pop it back in somewhere else. (replacing "menu stuff" with the code used in hooks-filters.php and something_or_other with the appropriate hook name)

    Posted 10 years ago #
  3. Hey, thanks for the help, the remove default actions code in the functions.php file worked like a charm, but I can't get the second one to work. I get the following error:
    Parse error: syntax error, unexpected '}' in /home/dougdix/public_html/wp-content/themes/thematic/header.php on line 35

    Thanks again

    Posted 10 years ago #
  4. I think the problem is my poor knowledge of PHP, but just making sure, do I simply copy and paste the second piece of code as-is (with the exception of the code from hooks-filters.php) wherever I want the navigation to appear? Whenever I do so, I get the above mentioned error.

    Thank you for the help,

    Micah

    Posted 10 years ago #
  5. The code snippets go in your Child Theme functions.php between line 1 and the last line (the opening and closing PHP tags).

    Posted 10 years ago #
  6. I see, so how do I dictate where I want the access div to appear?

    Posted 10 years ago #
  7. Never mind, I figured it out. I see what you were trying to tell me! I used the below code: <?php }
    add_action('thematic_aboveheader','childtheme_access',);

    Posted 10 years ago #
  8. ondrae
    Member

    All that I have to add is:

    // Remove default Thematic actions
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    
    add_action('thematic_belowheader','thematic_access',9);

    No need to repeat the code from the hook-filters. Am I set up weird or is this the correct way?

    Posted 10 years ago #
  9. Jamie Mitchell
    Member

    ondrae...i just tested your code and it works a treat, i used thematic_aboveheader rather than thematic_belowheader, and it puts the menu right to the top...

    cool J

    Posted 9 years ago #
  10. missbou
    Member

    Hey, this is awesome! I followed ondrae's "recipe," and it worked like a charm -- that is, when I pasted this in the Thematic (parent) theme functions.php file. When I try to place it in the functions.php file I copied into my child theme folder, I get this error:

    Fatal error: Cannot redeclare thematic_remove_generators() (previously declared in /home/...childtheme/functions.php:71) in /home/...thematic/functions.php on line 71

    Why is that? To start with, I don't understand why the Thematic functions.php file is considered to be "redeclaring" anything. Should I not be modifying functions.php with a copy in the child theme folder, like we do for style.css?

    Thanks!

    Posted 9 years ago #
  11. You declared thematic_remove_generators() in Thematic's functions.php which will be used by your child theme .. and now you put the same function into your child theme's functions.php which causes this problem.

    PHP now doesn't know which thematic_remove_generators()it should use .. delete the function from Thematic's functions.php and everything is fine again.

    And .. yes you're right. Every change should be done in your child theme's directory / files.

    Cheers,

    Chris

    Posted 9 years ago #

RSS feed for this topic

Reply

You must log in to post.