Child file for footer.php?

  • jrothra

    #1485

    I decided this actually belongs in a different thread than this one: https://forum.graphene-theme.com/graphene-support/how-to-change-follow-me-text-on-twitter-widget

    Even after reading WP’s description on child themes, I have many questions. However, for now, I’m curious about the footer.php file. I am adding a custom menu into the footer in lieu of the Meta widget, which I can’t customize. There is a link I want added that will be visible only to Admins who are logged in. I was thinking, can I create a file called footer.php in the child theme, and insert only this code in it:

    <div class="footer-menu-wrap">
    <ul id="footer-menu" class="clearfix">
    <?php /* Footer menu */
    $args = array(
    'container' => '',
    'fallback_cb' => 'none',
    'depth' => 2,
    'theme_location' => 'footer-menu',
    'items_wrap' => '%3$s'
    );
    wp_nav_menu(apply_filters('graphene_secondary_menu_args', $args));
    ?>
    <?php if ( ! $graphene_settings['hide_return_top'] ) : ?>
    <li class="menu-item return-top"><a href="#"><?php _e('Return to top', 'graphene'); ?></a></li>
    <?php endif; ?>

    <!--ADDED BY JOHN START -->
    <li><a href="#">Control Panel</a>
    <ul class="sub-menu"><li><?php wp_register(); ?></li>
    <li><?php wp_loginout(); ?></li>
    <?php wp_meta(); ?>
    <!--LINK TO HOW TO VIDEOS FOR ADMINS ONLY-->
    <?php global $user_ID; if( $user_ID ) : ?>
    <?php if( current_user_can('level_10') ) : ?>
    <li><a href="http://www.greggcountygop.com/howto/">Instructional Videos</a></li>
    <?php endif; ?>
    <?php endif; ?>
    <!--END LINK TO HOW TO VIDEOS FOR ADMINS ONLY--></ul></li>
    <!--ADDED BY JOHN END -->

    </ul>

    </div>

    This way, only the div containing the custom menu is in the child footer.php file. If I do this, will the site pull the parent theme’s footer.php file and replace this portion? Or will it replace the entire footer.php file with the child footer.php?

    jrothra

    #15981

    Actually, as I look at what similar groups have done, they have no login info/meta on their site. So I may just scrap the “control panel”/meta info anyway. Admins will have the link to get into the site anyway.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Do NOT follow this link or you will be banned from the site!