Creating A footer2.php File (6 posts)

  1. alanchrishughes
    Posted 6 years ago #

    I've been working on a theme, but I realized I will not want my nice big 4 column footer widget area on all pages/templates. So I just saved a footer.php with the basic credits and info, and thought I could create a footerWidgets.php that I could just drop in <?php get_footerWidgets(); ?> on templates where I do want this widget area.

    But that is obviously missing some programing/php/functioning/stuff I don't know about. Is there any easy way of creating new site section php files that WordPress will recognize?


  2. Michael
    Forum Moderator
    Posted 6 years ago #


    get_footer('Widgets') and a file footer-Widgets.php



    <?php include( TEMPLATEPATH . '/footerWidgets.php' ); ?>

  3. alanchrishughes
    Posted 6 years ago #

    Thank you, I got it working but I'm still curious if there is a way to create a direct link to it like the way you do for get_footer or get_sidebar etc...

  4. Rev. Voodoo
    Posted 6 years ago #

    there is.... that was the first thing @alchymyth was referring to. You just have to name the file correctly....

    file name: footer-custom.php call: get_footer('custom')


    file name: sidebar-custom.php call: get_sidebar('custom')

  5. alanchrishughes
    Posted 6 years ago #

    No I got that working fine and I understand that, I just mean something new and unique to itself that you can directly link to like <?php get_notepad(); ?>

  6. gwc_wd
    Posted 5 years ago #

    From my reading the footer-custom.php file is unique to a particular theme.

    I would like to add a small (and common) code snippet

    <?php echo get_num_queries(); ?> queries. <?php timer_stop(1); ?>

    in a way that is not theme-dependent and upgrade proof.

    Is there code that could be include in custom-php.php which file works with all themes?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.