ThemeShaper Forums » Thematic

[closed]

template-specific menu

(3 posts)
  • Started 6 years ago by bluejpro
  • Latest reply from bluejpro
  • This topic is not resolved
  1. To create a child theme with the main menu in the left sidebar, I removed the access div from the header --

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

    But now, I need a full width template with the access div above the header.
    I want the access div above the header for this template only, not all the templates.
    This code adds the access div to all the templates.
    I don't know why the conditional statement is not working:

    // Moving the thematic menu above the header
    // only for full width pages
    // replace menu with new hook
    function fullwidth_access_menu() {
    $hook = 'thematic_header';
    if( is_page_template('template-page-fullwidth.php')) $hook = 'thematic_aboveheader';
    add_action($hook,'thematic_access');
    }
    add_action('get_header','fullwidth_access_menu');

    Can anyone see the problem?

    Posted 6 years ago #
  2. middlesister
    Member

    Well what you code is saying is basically "put thematic access in thematic_header, unless it is template-page-fullwidth.php. If it is, put access in thematic_aboveheader". The code is adding the access div to the header in every case, just in different places. I am not really clear on exactly what you want, but if you have removed the access div with the code above and only want it back on the fullwidth template, you can put it back with

    function fullwidth_access_menu() {
    	if ( is_page_template('template-page-fullwidth.php') ) {
    		add_action('thematic_aboveheader','thematic_access');
    	}
    }
    add_action('template_redirect','fullwidth_access_menu');

    You can also look at http://forums.themeshaper.com/topic/conditional-function-for-home-page#post-10942.

    Posted 6 years ago #
  3. That absolutely solved the problem.

    Thanks middlesister.

    Posted 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.