ThemeShaper Forums » Thematic

[closed]

Adding a menu to 1st Subsidiary Aside

(5 posts)
  • Started 6 years ago by proto
  • Latest reply from proto
  • This topic is resolved
  1. proto
    Member

    Hi there,

    I'm trying to register a menu with my child theme so that it displays in Thematic's 1st Subsidiary Aside. I searched the visualising thematic for you and could not see the action hook to attach my menu to the 1st subsidiary aside. I realise I can manually enter widgets (with hard coded HTML links to appear here). But I wondered if anyone knows if it's possible to hook my new menu onto the 1st subsidiary aside. When I searched the source code for Thematic it came up with the 1st subsidiary as an array, does this mean I can't hook onto it (I suspect the answer is yes I can't hook onto it).

    Here's my code for registering and adding the new menu:

    //Registering a menu for the 1st Subsidiary Aside
    
    register_nav_menus(array('secondary' => __('Bottom Left Menu')));
    
    //Adding a menu for the 1st Subsidiary Aside
    
    function pixelwoo_bottom_left_menu() {
    	wp_nav_menu(array('theme_location' => 'secondary' , 'fallback_cb' => ''));
    	}
    
    add_action('1st-subsidiary-aside', 'pixelwoo_bottom_left_menu');

    I suspect their may not be a hook "1st-subsidiary-aside" to attach my new menu! If I'm having a major face + palm moment please tell me!! Assume I'll have to hard code anything to display in the subsidiary asides? :)

    Posted 6 years ago #
  2. sowingseeds
    Member

    Have you considered the hooks: thematic_abovemainasides / betweenmainasides?

    Posted 6 years ago #
  3. there isn't a hook called first subsidiary aside. the subsidiaries are created on the widget_area_subsidiaries hook (probably will be renamed) that is added to the thematic_footer hook.

    from footer-extensions.php:

    if (function_exists('childtheme_override_subsidiaries'))  {
    		function thematic_subsidiaries() {
    			childtheme_override_subsidiaries();
    		}
    	} else {
        	function thematic_subsidiaries() {
           	 widget_area_subsidiaries();
        	}
        }
        add_action('thematic_footer', 'thematic_subsidiaries', 10);

    from widgets-extensions.php:

    '1st Subsidiary Aside' => array(
    			'admin_menu_order' => 300,
    			'args' => array (
    				'name' => '1st Subsidiary Aside',
    				'id' => '1st-subsidiary-aside',
                    'description' => __('The 1st widget area in the footer.', 'thematic'),
    				'before_widget' => thematic_before_widget(),
    				'after_widget' => thematic_after_widget(),
    				'before_title' => thematic_before_title(),
    				'after_title' => thematic_after_title(),
    				),
    			'action_hook'	=> 'widget_area_subsidiaries',
    			'function'		=> 'thematic_1st_subsidiary_aside',
    			'priority'		=> 30,
    			),

    you can see that the different subsidiaries have different priorities on the widget_area_subsidiaries hook.

    the only way to get inside the first subsidiary, would be to filter the thematic_widgetized_areas variable and send the first subsidiary a new function other than thematic_1st_subsidiary_aside(). in that function you could add the menu.

    except, WP comes with a default custom menu widget, so you don't need to hard-code it in a text widget. why can't you use that?

    Posted 6 years ago #
  4. proto
    Member

    Thank you both for your replies!

    What a great community this is indeed!

    Thank you, I was looking at the high road and didn't realise that all along that the easy path was right there in front of me! Thank you Helga and Sowingseeds!

    :)

    Posted 6 years ago #
  5. proto
    Member

    PS - In case you were wondering I went for Helga's solution (not a surprise as she is always helping people out!!) of using the custom menu widget and dropping that into the subsidiaries...

    Thanks again!

    ...(is now off to facepalmage.com)...

    Posted 6 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.