?
Solved

Wordpress - use multiple footers

Posted on 2014-10-11
10
Medium Priority
?
195 Views
Last Modified: 2014-11-06
Hi - Currently I have a footer that contains a BBB logo. That logo should only be on one page. I also need to insert another BBB logo, with different code, into another page. There are about 12 other pages that need no BBB logo at all so I need to remove that.

I'm wondering what the best approach is if this is possible.

Here's a link to one of the site pages: page link
0
Comment
Question by:Trevor Local
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 40375222
0
 

Author Comment

by:Trevor Local
ID: 40375224
Yeah - the site is a mess and will be redone in a few months. Until then we're limping along...
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 2000 total points
ID: 40375344
I'm wondering what the best approach is if this is possible.

Usually the best approach is to use one of the WordPress conditionals in footer.php to determine what page is being displayed and showing/hiding whatever content.  If you only want the BBB on the home page, is_home() is the conditional to use.

But those blocks look like they are widget containers.  Are they?
0
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 

Author Comment

by:Trevor Local
ID: 40375691
But those blocks look like they are widget containers.  Are they?

Not sure which blocks you're referring to.

I'm thinking maybe I'll remove the BBB logo from the footer, and then add the two somewhere else, like on the contact page.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40375793
From the link above, there is a true "footer" area that holds just the copyright statement.

Above that are 4 content blocks in a with the BBB logo in the fourth one (rightmost).  What I can't tell from the HTML and CSS designations is if those four content blocks are actually a footer (and thus editing footer.php is the answer) or if they are widgets or some other form of preset text (e.g. A theme control panel option?).

Tl;dr Where is the logo HTML being set?  Which theme is this?
0
 

Author Comment

by:Trevor Local
ID: 40376303
Yes, all those blocks are inside the footer.php.

It's a custom theme.

Where is the logo HTML being set?
Not sure what you mean.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40376311
Not sure what you mean.

Where, in the theme files, is the HTML that calls the BBB logo?  What does that code block look like?

Yes, all those blocks are inside the footer.php.

So you should be able to open footer.php, find the code that calls the BBB logo and wrap it with is_home().  That will change the footer behavior to only show the BBB logo on the home page of the site and all other pages will hide it.
0
 

Author Comment

by:Trevor Local
ID: 40377472
I think I understand the concept. Here is the footer code:

<div id="block_area2">



<div class="blockitem2">



<h3>Ducerus</h3>



<ul>



<?php 



$subMenu1 = array(



'container' => false, 



'theme_location'  => 'sub_menu1',



'menu_class'      => 'subNav',



'items_wrap' => __('%3$s')



);							



wp_nav_menu( $subMenu1 ); 



?>



</ul>



</div><!--ends first block item-->



<!--third block item-->



<div class="blockitem2" style="margin-left: 32px;">



<h3>Resources</h3>



<ul>



<?php 



$subMenu2 = array(



'container' => false, 



'theme_location'  => 'sub_menu2',



'menu_class'      => 'subNav',



'items_wrap' => __('%3$s')



);							



wp_nav_menu( $subMenu2 ); 



?>



</ul>



</div><!--ends third block item-->



<!--fourth block item-->



<div class="blockitem2" style="display: table;



    margin-left: 112px;



    width: auto;">



<h3>Follow Us!</h3>



<ul style="display:block;width:70px;">



<?php 



$subMenu3 = array(



'container' => false, 



'theme_location'  => 'sub_menu3',



'menu_class'      => 'subNav',



'items_wrap' => __('%3$s')



);							



//wp_nav_menu( $subMenu3 ); 



/*if(is_user_logged_in())



{



?>



<li><a href="<?php echo wp_logout_url(); ?>" title="Login">Logout</a></li>



<?php } else { ?>



<li><a href="<?php echo wp_login_url(); ?>" title="Login">Advisor Login</a></li>	



<?php } */ ?>



    <li><a href="https://www.facebook.com/ducerus"><img width="32" height="32" src="http://www.ducerus.com/images/socialmedia/submenu/facebook.png"></a> <a href="http://pinterest.com/ducerus/"><img width="32" height="32" src="http://www.ducerus.com/images/socialmedia/submenu/pintrest.png"></a></li>



    <li><a href="http://www.youtube.com/ducerus"><img width="32" height="32" src="http://www.ducerus.com/images/socialmedia/submenu/youtube.png"></a> <a href="https://plus.google.com/108480413841984554987/about?hl=en-US"><img width="32" height="32" src="http://www.ducerus.com/images/socialmedia/submenu/google-plus.png"></a></li>                



    <li><a href="https://twitter.com/ducerushq"><img width="32" height="32" src="http://www.ducerus.com/images/socialmedia/submenu/twitter.png"></a> <a href="http://www.linkedin.com/company/ducerus"><img width="32" height="32" src="http://www.ducerus.com/images/socialmedia/submenu/linkedin.png"></a></li>



</ul>



</div><!--ends fourth block item-->



<!--fifth block item-->



<div class="blockitem2" style="display: table;



    margin-left: 168px;



    width: auto;">



<h3>Login</h3>



<ul>



<?php 



$subMenu4 = array(



'container' => false, 



'theme_location'  => 'sub_menu4',



'menu_class'      => 'subNav',



'items_wrap' => __('%3$s')



);							



wp_nav_menu( $subMenu4 ); 



if(is_user_logged_in())



{



?>



<li><a href="<?php echo wp_logout_url(); ?>" title="Logout">Branch Logout</a></li>



<?php } else { ?>



<li><a href="<?php echo wp_login_url(); ?>" title="Login">Branch Login</a></li>	



<?php } 



/*



<!--fifth block item-->



<div class="blockitem3">



<h3>Follow Us and register for our newsletter</h3>



<ul class="social-links">



<li><a href="http://www.facebook.com/pages/Ducerus/174912385890067" target="blank;"><img src="<?php echo IMG; ?>/socialmedia/facebook.png" alt="" /></a></li>



<li><a href="http://twitter.com/ducerus" target="blank;"><img src="<?php echo IMG; ?>/socialmedia/twitter.png" alt="" /></a></li>



<li><a href="#" target="blank;"><img src="<?php echo IMG; ?>/socialmedia/linkedin.png" alt="" /></a></li>



<li><a href="#" target="blank;"><img src="<?php echo IMG; ?>/socialmedia/rss.png" alt="" /></a></li>                            



</ul>



</div><!--ends fifth block item--> 



*/ ?>



</ul>

<p>&nbsp;</p>

<a title="Ducerus BBB Business Review" href="http://www.bbb.org/san-diego/business-reviews/schools-academic-college-preparatory/ducerus-in-carlsbad-ca-172004905/#bbbonlineclick"><img alt="Ducerus BBB Business Review" style="border: 0;" src="http://seal-sandiego.bbb.org/seals/blue-seal-96-50-ducerus-172004905.png" /></a>

</div><!--ends fourth block item-->  



</div><!--ends second block area-->



<!--This sections contains the website authenticity and security seals-->



<div id="seals">



<!--seal 3 item-->



<div class="seal"><a href="#" id="seal3" target="_blank"></a></div>



<!--seal 1 item-->



<div class="seal"><a href="http://godaddy.com" id="seal1" target="_blank"></a></div>



<!--seal 4 item-->



<div class="seal"><span style=" display:block; font-size:16px; width:584px;">Featured in:</span></div>   



</div><!--ends seals-->



<div id="footerwrapper">



<div id="disclaimers"><a href="<?php echo get_permalink(get_option(PREFIX.'footer_policy')); ?>">Privacy Policy</a> | <a href="<?php echo get_permalink(get_option(PREFIX.'footer_disclaimer')); ?>">Disclaimer</a> </div><!--ends disclaimer-->



<div class="copyright"><?php echo get_option(PREFIX.'footer_copyright'); ?></div><!--ends copyright-->



</div><!--ends footerwrapper-->



</div><!--ends div id container-->



<?php global $user_login; get_currentuserinfo(); ?>



<script type="text/javascript">



var $theRegLink = '<?php echo get_permalink(get_option(PREFIX.'is_reg_page')); ?>';



var $theSiteURL = '<?php echo SITEURL; ?>';



var $theCatClass = '.cat<?php echo tsw_get_id_by_event_category($user_login); ?>';



var $locCatClass = '.cat<?php echo isset($_SESSION["TSWcatID"]) ? $_SESSION["TSWcatID"] : 29; ?>';



</script>



<?php wp_footer(); ?>



<?php if(is_user_logged_in()) { ?>



<script type="text/javascript">



jQuery.noConflict();



jQuery(document).ready(function(){



jQuery($theCatClass).trigger('click');	



});



</script>



<?php } else { ?>



<script type="text/javascript">



jQuery.noConflict();



jQuery(document).ready(function(){



jQuery($locCatClass).trigger('click');	



});



</script>



<?php } // print_r($_SESSION);?>



<script type="text/javascript" src="https://m430.infusionsoft.com/app/webTracking/getTrackingCode?trackingId=976b898d2d821841a7cc2b8abedc7c4c"></script>



</body>







</html>

Open in new window


But I think the problem will be that the "home" page in this case doesn't have the footer. This home page url  ducerus.com/franchisee - which contains all the different site locations pages (calendars, contact page) - redirects back to ducerus.com, which doesn't have that footer.

http://www.ducerus.com/locations.php shows all the locations, and the links go to the ducerus.com/franchisee pages. Carlsbad location should have the current logo, Ft. Worth will have new logo. No other location should have a BBB logo.

Is there a way to wrap the code specifically for the two pages that need the BBB logo?

thank you
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 2000 total points
ID: 40377559
Is there a way to wrap the code specifically for the two pages that need the BBB logo?

Yes.  Concept is the same, execution differs slightly.  Instead of performing a check for is_home(), you switch to is_page() and add a parameter that checks for specific ID, page title, or slug (ID preferred) and do something based on results.

So:
if ( is_page( array( 42, 50 ) ) {
    Do something;
} else { 
    Do something else;
}

Open in new window


Ref: http://codex.wordpress.org/Function_Reference/is_page
0
 

Author Closing Comment

by:Trevor Local
ID: 40427689
thank you
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question