Create Your Own WordPress Framework From Scratch: Lesson 6 – Building footer.php

In this lesson we will build the footer.php template.

We will ‘wigitize’ it so we can easily add menus and widgets to our footer. This will make our theme even more customizable for non-technical users. We already registered the footer in our functions.php so wigitizing it is trivial.

We will also add copyright info and the wp_footer() hook so WordPress and plugins will be able to add scripts. Do not leave wp_footer() out of your theme.

Add the following code to footer.php.

        <footer class="footer"> 
            <?php if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar( 'Footer' ) ) : ?>
                <section class="footer-widget widget">
                    <h1 class="widget-title"><?php _e( 'Pages','wft' ); ?></h1>
                    <ul>
                    <?php wp_list_pages('title_li=' ); ?>
                    </ul>
                </section>
                <section class="footer-widget widget">
                    <h1 class="widget-title"><?php _e( 'Category','wft' ); ?></h1>
                    <ul>
                    <?php wp_list_categories( 'title_li=' ); ?>
                    </ul>
                </section>
            <?php endif; ?>
        </footer>
        <small class="copyright">
            <?php bloginfo(); ?> © <?php echo date( 'Y' ); ?>
            All Rights Reserved. - WordPress Theme by: <a href="http://www.elizabeth-rogers.com">Elizabeth Rogers</a>
            <!-- wp_footer -->
            <?php wp_footer(); ?>
        </small>
    <!--end wrapper-->
    </div>
</body>
</html>

In our next lesson we will build our sidebar. It will also contain widgets.