ThemeShaper Forums » Thematic

[closed]

How to move page menu from #access to new div above header

(12 posts)
  • Started 4 years ago by grapesoda
  • Latest reply from TyeNewton
  • This topic is resolved
  1. grapesoda
    Member

    Hi there,

    I'd like to know how to move the page menu (about, rss feed etc.) from my child theme (Gallery by Chris Wallace) out of the #access div and into it's own div (i.e #top-menu) either above the #header div or within the #header div but above #branding.

    Help would be much appreciated, thanks!

    Posted 4 years ago #
  2. grapesoda
    Member

    Sorry forgot to mention, is it possible to do this without touching the Thematic theme, just in the child theme? Thanks.

    Posted 4 years ago #
  3. Just add to your child theme's functions.php, no need to mess around w/ the core thematic files... that is the beauty of the whole setup.

    This will delete the thematic access from its current hook.

    function remove_access() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_access');

    I always check this diagram when I need to figure out where stuff goes:
    http://bluemandala.com/thematic/thematic-structure.html

    To put it above the header div then you could add it to thematic_aboveheader() hook.

    add_action('thematic_aboveheader','thematic_access');

    Or to put it inside the header but before the branding, I think you'd need to move thematic_brandingopen() from hook 1 to hook 2 (see that diagram again).

    This will delete the thematic access and brandingopen from their current hooks.

    function remove_defaults() {
        remove_action('thematic_header','thematic_brandingopen,1);
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_defaults');
    
    add_action('thematic_header','thematic_access',1);
    add_action('thematic_header','thematic_brandingopen',2);
    Posted 4 years ago #
  4. grapesoda
    Member

    Hi Helga thanks so much for getting back to me.

    It isn't the whole access div i need to move though, only the page menu (not catgories). Any idea how this would be achieved?

    I'm looking for something (top navigation) like this: http://www.cozmoslabs.com/projects/commune/

    Thanks.

    Posted 4 years ago #
  5. Ok, I didn't understand what you were trying to do. But if you want to emulate commune (And it is a hell of a theme to emulate) then why not download Commune and check out how it was done? I happen to have Commune on my computer so I just checked in the functions.php.

    /* ********************************************** */
    /* Add the Top Pages Menu */
    /* ********************************************** */
    function comune_topmenu() {
    ?>
    <div id="topmenu">
    	<?php if (is_home()) { ?>
    		<h1 id="blog-description"><?php bloginfo('description') ?></h1>
    	<?php } else { ?>
    		<div id="blog-description"><?php bloginfo('description') ?></div>
    	<?php } ?>
    
    	<?php
    		if ( $menu = str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages('title_li=&sort_column=menu_order&echo=0') ) )
    		$menu = '<ul>' . $menu . '</ul>';
    		$menu = '<div id="page_menu">' . $menu . "</div>\n";
    		echo $menu;
    		//echo 'test?';
    	?>
    </div>
    <?php
    }
    add_filter('thematic_aboveheader','comune_topmenu');
    
    /* ********************************************** */

    Or instead of echoing back that $menu (which relies on wp_list_pages(), you could hard code it yourself.... or simply throw &include=1,2,3 into your wp_list_pages() argument w/ the IDs of whatever pages you want to include.

    The function for creating the categories menu is also in the commune functions file.

    Posted 4 years ago #
  6. grapesoda
    Member

    Thanks Helga I'll have a look at that just now :). I should have said I'm a PHP noob too so I'll figure it out as I go. Thanks again!

    Posted 4 years ago #
  7. oh i'm a cut-and-paste coder at best, but since i get so much help here I am glad i could help someone else.

    Posted 4 years ago #
  8. helgatheviking, thanks for your snippets, you've resolved a similar issue for myself as well

    Posted 4 years ago #
  9. Third thank you, Miss Viking, especially for the reprioritize code for brandingopen. I really wanted the menu in header, not aboveheader. (Not sure if is browser-specific or universal (I use FF3.6 mainly) but whenever I put something in aboveheader, at the next instance of visiting the site, the viewable area begins at the top of header and I have to scroll up to see anything above. That may have certain advantages in some instances, say, a meta or login area but it's hardly an ideal place for primary navigation.)

    Posted 4 years ago #
  10. TyeNewton
    Member

    Oh my gosh... is there any way to move #access into #main (above the content and asides) so it can appear on top of the background image of #main? I've been examining the bluemandala diagram, and there don't appear to be any action hooks within #main except for those just in the asides column.(?)

    By the way, this will be my first attempt at utilizing an action hook, so if I end up saying something silly, that'll be why. ; )

    Posted 2 years ago #
  11. @tye - check out http://visualizing.thematic4you.com/ thematic_abovecontainer() and thematic_abovecontent() are both inside of #main

    Posted 2 years ago #
  12. TyeNewton
    Member

    Ahah! So the bluemandala diagram perhaps just missed some hooks? (Or maybe it was created for a previous version of Thematic; I'm still brand new to the scene.)

    In any case, thanks so much, Helga; you are wildly helpful all over this forum, and to me specifically.

    I just found your link to WPCandy's introduction to hooks, so hopefully I'll figure the rest out without asking any more questions. Wish me luck!

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.