• Resolved Greg Robertson

    (@517design)


    I’ve created a new footer footer-pillpack.php and I have the original footer footer.php

    I can put each one on the same template and they both show, using

    <?php get_footer( ‘pillpack’ ); ?>

    or

    <?php get_footer(); ?>

    so i know the above code is working

    What I’m trying to do is have the footer-pillpack.php show on only one page called: https://a1medicalsupply.us/pillpack/

    And footer.php show on every other page.

    Here is my code that I am putting on my page.php file

    <?php
    if ( is_home() ) :
    get_footer();
    elseif ( is_single( ‘pillpack’ ) ) :
    get_footer( ‘pillpack’ );
    else :
    get_footer();
    endif;
    ?>

    It’s not working. The footer.php file is showing on every page including the https://a1medicalsupply.us/pillpack/ page.

    I’m new to this… Any one know what I’m doing wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi 517Design. Give this a try:

    <?php
        if ( is_page('pillback') ) {
            get_footer( 'pillpack' );
        } else {
            get_footer();
        }
    ?>

    or

    <?php
        if ( is_page('pillback') ):
            get_footer( 'pillpack' );
        else:
            get_footer();
        endif;
    ?>

    Thread Starter Greg Robertson

    (@517design)

    Thanks bdbrown for the reply. Neither one of those worked. I’ve been reading the WP codex and it seems like they should. I’ll gladly try any other suggestions you have. Thanks

    Thread Starter Greg Robertson

    (@517design)

    I found the solution. I used the page id instead of the slug. Go figure but it worked. Thanks bdbrown for getting me most of the way there. Here is what worked

    <?php
    if ( is_page(‘2705’) ) {
    get_footer( ‘pillpack’ );
    } else {
    get_footer();
    }
    ?>

    You’re welcome; glad you found a solution.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Different footer for different pages not working’ is closed to new replies.