• Hello,

    I’d like to have two different footers for a website I’m working one. One for the portion of the website that’s free and one that’s for the membership portion of the website.

    What would be the best way to go about this? Would it be best to just create a microsite for the membership portion that way I can create it’s own footer that way or could i do it by create a new footer.php file and assigning to certain pages (this is my preferred method?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I’d edit footer.php and add some conditional to it, along the lines of

    if ( $this_is_the_membership_portion) { show this content }

    Moderator bcworkz

    (@bcworkz)

    I agree with Steve. A conditional is the fundamental basis for alternative content. Depending on how much and what is the same or different, you may want an “else” condition as well. If the differences are substantial, you could organize the content into separate files and conditionally include the files with get_template_part().
    get_template_part('footer-content', $this_is_the_membership_portion?'member':'public');

    That might be almost the entirety of your footer.php template. You’d then have two different footer content template files: footer-content-member.php and footer-content-public.php

    There are any number of variations you can implement on the basic conditional concept. In case you are not familiar with the condition?'member':'public'; ternary construct, it’s a shorthand way of using conditional logic. This example is equivalent to if condition is true then return ‘member’ else return ‘public’.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @bmwaldrop Please do not create multiple topics for the same thing. I’ve closed your newer topic. If you’ve something to add then please do so here.

    Thread Starter bmwaldrop

    (@bmwaldrop)

    OK,

    SO I had this working,then changed the page id and now it’s no longer working. I tried changing it back to the previous page id and it’s still not working. Ultimatley, I need it on two pages, 6385 and 7187. But if I can get it on this page for now, that’d be a start. Here’s code. Any ideas?

    <?php
    if (is_page ('6385')  ):
    	get_footer('member');
    else :
    	get_footer();
    endif;
    ?>

    Here’s a link if needed.
    Page

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Remove the string delimiters — you’re looking for a page ID so use is_page( 6385)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Two separate footers’ is closed to new replies.