Footer.php在不同的页面上显示不同

时间:2016-10-06 18:33:07

标签: css wordpress

我试图在上周更新我们的移动网站,但我遇到了页脚问题。它在主页上加载正常,但在普通页面上崩溃。两者都使用相同的footer.php文件。

我正在处理的暂存网站是: http://premierdism.staging.wpengine.com/



<?php
/**
 * The template for displaying the footer.
 *
 */
?>				<div class="clearfix"></div>
				</div><!-- .site_content .inner-wrapper -->
        	</div><!-- .site_content -->
            <?php if(!is_front_page()):?>
				<?php if(!is_page(52)):?>
                <div class="page-cta">
									<h4 style="font-family: Georgia;font-size: 40px !important; font-weight: bold; color: #075aa0;">Free, No Obligation</h4>
									<h5 style="font-size: 40px !important; font-weight: 500; line-height: .6 !important; margin-top: 0px; color: #075aa0;;">Disability Evalution</h5>
									<hr style="border-top: 1px solid #39393b; width:90%;">
									<p style="font-size: 30px !important;">Let us help you determine if you<br>qualify for disability income<p>
									<div style="height:20px;"></div>
									<a title="Free social Security Evaluation" href="http://premierdism.staging.wpengine.com/contact-us/free-evaluation/">Free Evaluation</a>
                </div>
                <?php endif;?>
            <img src="http://premierdism.staging.wpengine.com/wp-content/uploads/2016/09/Premier_Bottom_Logos.png" />
            <?php else:?>
            <div class="home-map">
            	<div class="inner-wrapper">
				<?php
                $args = array(
                    'numberposts' => -1,
                    'post_parent' => 56,
                    'post_type' => 'page',
                    'orderby' => 'title',
                    'order' => 'ASC'
                );
                $children = get_children( $args );
                ?>
                <?php if($children):?>
                    <div class="state-list">
                        <p style="align:left; Color:#a32a2f; margin-bottom:0px;"><b>Click the map below<br>for more state information</b></p>
												<hr style="margin-top: 0px; margin-bottom: 0px; margin-right: 0px; width: 570px; border-top: 2px solid #a32a2f;" />
												<p align="left">All 50 states and territories</p>
                        <a href="https://m.premierdisability.com/the-premier-difference/nationwide-disability-benefits/"><img src="http://premierdism.staging.wpengine.com/wp-content/uploads/2016/09/Premier_Map.svg" alt="Premier Disability offers nationwide help"/>
                            &nbsp;
						<div class="clearfix"></div>
                    </div>
                <?php endif;?>
                </div>
            </div>
            <?php endif;?>
        	<div class="clearfix"></div>
        	<div class="site-footer">
                <div class="footer-disclamier">
                  <div class="inner-back">
                        <div class="inner-wrapper" style="background-color: #e3e3e3; width: 640px; margin: -20px 0px 0px -40px; padding: 20px 0px;">
                          <p class="sharelink">Keep in touch</p>
                            <div style="padding-bottom:80px;" class="social relative">
                                <div style="position: absolute; left: 20%;">
					                         <a class="block left" href="https://www.facebook.com/PremierDisability" target="_blank"><img src="http://premierdism.staging.wpengine.com/wp-content/uploads/2016/09/Facebook-Icon.jpg" style="width:60px;"></a>
																		<a class="block left" href="https://plus.google.com/110325482012270783070" target="_blank"><img src="https://m.premierdisability.com/wp-content/uploads/2016/09/GooglePlus-Icon.png" style="width:60px;"></a>
		                                <a class="block left" href="https://twitter.com/PremierDisSvcs" target="_blank"><img src="https://m.premierdisability.com/wp-content/uploads/2016/09/Twitter-Icon.png" style="width:60px;"></a>
		                                <a class="block left" href="https://www.instagram.com/premierdisabilityservices/" target="_blank"><img src="https://m.premierdisability.com/wp-content/uploads/2016/09/Instagram-Icon.png" style="width:60px;"></a>
                                </div>
																<div style="padding: 0px 109px; margin-top: 90px;">
																		<a href="https://itunes.apple.com/us/app/premier-ssd/id1143571193?mt=8"><div class="applink Apple"></div></a>
																		<a href='https://play.google.com/store/apps/details?id=com.goodbarber.premierdis&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><div class="applink Google"></div></a>
																</div>
                            </div>
                        </div>
												<div class="small-disclaimer"><p style="font-size:12px !important;margin-top: 20px;line-height:1.2;"><b>Disclaimer:</b> We are a privately owned, nationwide advocacy service. Any information you receive on this site is not intended to be, nor should it be construed as, legal advice. Using this website or contacting us does not create any type of legal or fiduciary relationship. Premier Disability Services, LLC is neither affiliated with nor endorsed by the Social Security Administration or any other government agency or entity.</p></div>
                    </div>
                </div>

                <div class="copyright">
                	<div class="inner-back">
                        <div class="inner-wrapper">
                            <?php Theme::getCopyright()?>
                        </div>
                    </div>
                </div>
        	</div><!-- .site-footer -->
		</div><!-- #main .wrapper -->
	</div><!-- #page -->

<?php wp_footer(); ?>
</body>
</html>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:0)

尝试将页脚php移动到自己的php文件中。然后只需include页面末尾的文件。我用它并且它有效。

为此,请从wp_footer()函数中获取代码并将其粘贴到新文件中。

然后在include 'new-wp-footer.php';页面上显示它。

更新

在包含之前尝试打开输出缓冲。然后抓住内容。

例如,

    ob_start();
    include('footer.php');
    $footer_content = ob_get_clean();
    echo $footer_content;

答案 1 :(得分:0)

您可以在此位置将margin-top: 90px更改为padding-top: 90px

<div style="padding: 0px 109px; margin-top: 90px;">
<a href="https://itunes.apple.com/us/app/premier-ssd/id1143571193?mt=8">
    <div class="applink Apple"></div>
</a>
<a href='https://play.google.com/store/apps/details?id=com.goodbarber.premierdis&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'>
    <div class="applink Google"></div>
</a>
</div>