ThemeShaper Forums » Thematic

Moving main menu on all pages except for font page

(8 posts)
  • Started 1 year ago by fleeps
  • Latest reply from helgatheviking
  • This topic is resolved
  1. fleeps
    Member

    Following this tutorial, i've moved the main menu to just above the container div. On the front page (i've set it as a static page), I'd like the menu to remain untouched (inside the header)

    I've tried the following but it doesn't do anything.
    <?php if ( !is_front_page() ).... ?>
    I'm new to wordpress and thematic. Any pointers would be appreciated.

    Cheers

    Posted 1 year ago #
  2. please post your full code and i'll try to see where you've gone astray

    Posted 1 year ago #
  3. fleeps
    Member

    Hey,
    thanks for your reply, and the very useful tutorial!

    My code is simple really. I've put this in the header-extensions.php file just above function thematic_belowheader()...

    if(!is_front_page()){
    		// Remove the standard Thematic menu
    		function remove_menu() {
    			remove_action('thematic_header','thematic_access',9);
    		}
    
    		add_action('init', 'remove_menu');
    		// Moving the thematic menu below the header
    		add_action('thematic_abovecontainer','thematic_access');
    	}
    Posted 1 year ago #
  4. well you aren't supposed to be putting anything in the header-extensions.php file. sounds like you need a tutorial on child themes first.

    http://www.catswhocode.com/blog/wordpress-how-to-easily-create-a-thematic-child-theme

    then you have to wrap your code up into a function and put it in YOUR functions.php. you run the function and it conditionally decides what to do, but you can't conditionally run functions (except IN other functions). clear as mud right?

    function move_thematic_access(){
    
    if(!is_front_page()){
    	remove_action('thematic_header','thematic_access',9);
    	add_action('thematic_abovecontainer','thematic_access');
        }
    }
    add_action('init', 'move_thematic_access');
    Posted 1 year ago #
  5. fleeps
    Member

    Thanks for the pointers.
    Your code didn't work for me but I managed to find a solution. I did the same as described in this post

    Thanks again,

    Posted 1 year ago #
  6. hmmm weird. that really should have worked, but i tried it myself and it is like the conditionals aren't working properly.

    i also tried

    function move_thematic_access(){
    if( is_home() || is_front_page() ){
    	//do nothing
    } else {
    	remove_action('thematic_header','thematic_access',9);
    	add_action('thematic_abovecontainer','thematic_access');
        }
    }
    add_action('init', 'move_thematic_access');

    and that didn't work either.. or the logic always came back false. i'm afraid i'm stumped, so i am glad you got it some other way.

    Posted 1 year ago #
  7. fleeps
    Member

    Replacing init with get_header worked for me

    function move_thematic_access(){
    if( is_front_page() ){
    	//do nothing
    } else {
    	remove_action('thematic_header','thematic_access',9);
    	add_action('thematic_abovecontainer','thematic_access');
        }
    }
    add_action('get_header', 'move_thematic_access');
    Posted 1 year ago #
  8. it also works on wp_head. my guess is that init is called too soon to successfully answer any logic. i feel like i have run into that before.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.