ThemeShaper Forums » Thematic

[closed]

Add main navigation links to footer in child theme

(14 posts)
  • Started 9 years ago by cotinus
  • Latest reply from whatsthebigidea
  • This topic is resolved
  1. cotinus
    Member

    Can you tell me how to add main navigation to the footer in a child theme? I
    * searched the forums
    * reviewed the "How I used a WordPress Child Theme To Redesign My Blog"
    * checked the Thematic options in the Admin panel
    but didn't find any topics/options on how to add the navigation to the footer.

    Perhaps I missed it?

    Posted 9 years ago #
  2. Hi,

    do you mean a page menu? .. or the standard superfish nav bar?

    Chris

    Posted 9 years ago #
  3. cotinus
    Member

    Hi Chris,

    Sorry for not being clear.

    I would like to add an unordered list of text links to the footer. For example:
    Home | About | Portfolio | Services | Contact

    Posted 9 years ago #
  4. Did you mean having the main nav on the footer as well?

    Try this:
    add_filter( 'thematic_abovefooter', 'wp_page_menu' );

    Posted 9 years ago #
  5. cotinus
    Member

    @kari

    I added your code to my child theme functions.php and it created a new div named .menu above the footer, with the same styling as the main navigation.

    What I want to do is produced an unordered list of the main navigation links in the footer, which I will style to display as text links. Here's the basic markup I want to include in the div id footer.

    < ul >
    < li >Home< /li >
    < li >About< /li >
    < li >Portfolio< /li >
    < li >Contact< /li >
    < /ul >

    I only want the top level navigation to display, not the sub-levels.

    Note: extra blank spaces added so the forum doesn't interpret the markup.
    Perhaps I misunderstood, I'm still new to Thematic.

    Posted 9 years ago #
  6. Well, try this then:

    function strip_classes($menu) {
    $menu = preg_replace( '/class="([-_a-z0-9 ]*?)"/i', '', $menu);
    echo $menu;
    }
    add_filter( 'wp_page_menu', 'strip_classes' );
    add_filter( 'thematic_abovefooter', 'wp_page_menu' );

    Posted 9 years ago #
  7. To use inside the footer use add_filter( 'wp_footer', 'wp_page_menu' ); instead.

    Posted 9 years ago #
  8. cotinus
    Member

    No, that doesn't work either. It adds the actual main navigation menu markup, with it's styling, after the footer div, but before the body tag.

    I want the unordered list code I referenced in the thread two messages above added into the footer div, not after it.

    So the code produced would be something like:

    < div id=" footer " >
    blah-blah
    < ul >
    < li >Home< /li >
    < li >About< /li >
    < li >Portfolio< /li >
    < li >Contact< /li >
    < /ul >

    more markup code

    < /div >

    Is there some way to add the Pages widget to the footer?

    Posted 9 years ago #
  9. cotinus
    Member

    I found that the "Commune" child theme at http://www.cozmoslabs.com/projects/commune/ has a similar footer that I'm trying to create. I installed the theme and activated it.

    The theme didn't show the content in the footer, and I couldn't find where the setting changes were for the widgets to display in the footer. Looked in footer.php, checked the widgets, but didn't find any that referenced the footer.

    From the markup source, it looks like the subisidiary widget was added to the footer. Which leads me to think this is done with widgets? Or is there some add filter I would need in Thematic?

    Unfortunately, when I changed back to my theme, all my widgets in my theme were missing! I had to recreate all the widgets that were in my theme. Frustrating - not sure why the widgets were lost.

    Posted 9 years ago #
  10. cotinus
    Member

    I've been searching for code to add to the functions.php to widgetize the footer in a child theme. No luck yet. Any pointers?

    Posted 9 years ago #
  11. cotinus
    Member

    Aha!

    After finding the wonderful Thematic structure at http://bluemandala.com/thematic/thematic-structure.html, I discovered in WP 2.8 the 1st, 2nd, and 3rd Subsidiary Asides allow you to add widgets to the footer div.

    Posted 9 years ago #
  12. Ah, didn't check where the wp_footer() hook inserts the markup.

    "It adds the actual main navigation menu markup, with it's styling" - really? My strip_classes() function worked just like it was supposed to for me. Did you get this resolved anyway with the widget?

    Posted 9 years ago #
  13. cotinus
    Member

    Yes, the subsidiary asides worked great!

    Posted 9 years ago #
  14. Thanks kari.patila. How could you ask for a more simple hook: add_filter( 'thematic_abovefooter', 'wp_page_menu' ); OR in my case:
    add_filter( 'thematic_belowfooter', 'wp_page_menu' );

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.