WordPress.org

Forums

Montezuma
Widgets in footer? (4 posts)

  1. alarsson
    Member
    Posted 1 year ago #

    In the admin interface of widgets, I would like to add widgets in the footer.
    Is it possible that you can add this in the next version of Montezuma theme?

  2. CrouchingBruin
    Member
    Posted 1 year ago #

    You don't have to wait for the next version, you can add a widget area yourself, in the current version, it's easy to do.

    First, go to Appearance > Montezuma Options > Main Templates and look at the template for pages (page.php) or single posts (single.php). You'll see that each one has a DIV at the bottom that looks like this:

    <div id="widgetarea-one" class="col4">
       <?php dynamic_sidebar( 'Widget Area ONE' ); ?>
    </div>

    This bit of code defines the widget area in the sidebar. The widget area is called Widget Area ONE, which you can see when you go to Appearance Widgets. The col4 class means that the sidebar is 4 columns (or 320px) wide. The rest of the content is 8 columns (640px) wide.

    What you want to do, then, is to copy the three lines of code above into your footer.php Sub Template (Appearance > Montezuma Options > Sub Templates > footer.php), probably just before the line that displays the copyright information. You want to change the name of the widget area, though. So your footer.php file might look something like this:

    <div id="footer-bg">
       <div id="footer" class="lw">
    
       <div id="widgetarea-footer" class="col12">
          <?php dynamic_sidebar( 'Widget Area FOOTER' ); ?>
       </div>
    
       <p>© <?php echo date( 'Y' ); ?> <?php bloginfo('name'); ?> — <?php __( 'All Rights Reserved.', 'montezuma' ); ?></p>
    
       <!--
       <p><?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?>  seconds.</p>
       -->	
    
       </div>
    
    </div>

    I called the new widget area Widget Area FOOTER. I gave the containing DIV an ID of widgetarea-footer so it can be styled easier with CSS. Note that I also gave the containing DIV a class of col12 so it will stretch across the entire width of the footer. If you are unfamiliar with how the grid column works, please read the documentation under Appearance > Montezuma Options > CSS Settings > Editing CSS.

    Once you save the footer.php subtemplate, you'll be able to go back to Appearance > Widgets and see a new widget area called Widget Area FOOTER, into which you can now drag your widgets.

    The beauty of this is that you can create multiple widget areas within the footer. If you want three widget areas, you can create each one with a class of col4 (or vary the widths, if you want to make one wider than the others); just give them different names, like Widget Area Footer Left, Widget Area Footer Center, and Widget Area Footer Right.

  3. alarsson
    Member
    Posted 1 year ago #

    I'm grateful for this!
    I have now fixed my widgets in the footer :) Many thanks!

  4. flippertie
    Member
    Posted 8 months ago #

    Thanks - still useful :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags