如何让我的整个页脚显示在所有页面模板上?它目前只显示在主页上。使用 wordpress

How do I get my entire footer to show up on all page templates? It is currently only showing up on the home page. Using wordpress

我正在使用使用 Cherry Framework 制作的 Wordpress 模板。完整的页脚只出现在主页上。我希望它出现在所有页面类型上,主要是 'fullwidth page templates'。

当我查看每个模板的 PHP 文件时,我看到的区别是:

<?php do_action( 'cherry_after_home_page_content' ); ?>

我似乎找不到 cherry_after_home_page_content 的定义位置。这可能是我要找的吗?我尝试将其复制到全角页面模板中,但它不起作用。如果我完全错了,那么正确的方法是什么?

无论模板类型如何,页脚都会出现在每个页面上。这是屏幕截图:

来自全角页面模板的代码:

<?php
/**
* Template Name: Fullwidth Page
*/

get_header(); ?>

<div class="motopress-wrapper content-holder clearfix">
    <div class="container">
        <div class="row">
            <div class="<?php echo cherry_get_layout_class( 'full_width_content' ); ?>" data-motopress-wrapper-file="page-fullwidth.php" data-motopress-wrapper-type="content">
                <div class="row">
                    <div class="<?php echo cherry_get_layout_class( 'full_width_content' ); ?>" data-motopress-type="static" data-motopress-static-file="static/static-title.php">
                        <?php get_template_part("static/static-title"); ?>
                    </div>
                </div>
                <div id="content" class="row">
                    <div class="<?php echo cherry_get_layout_class( 'full_width_content' ); ?>" data-motopress-type="loop" data-motopress-loop-file="loop/loop-page.php">
                        <?php get_template_part("loop/loop-page"); ?>
                    </div>
                </div>
            </div>
            <?php do_action( 'cherry_after_home_page_content' ); ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>

仅出现在主页上的完整页脚。下面是截图:

来自主页模板的代码:

<?php
/**
* Template Name: Home Page
*/

get_header(); ?>

<div class="motopress-wrapper content-holder clearfix">
    <div class="container">
        <div class="row">
            <?php do_action( 'cherry_before_home_page_content' ); ?>
            <div class="<?php echo apply_filters( 'cherry_home_layout', 'span12' ); ?>" data-motopress-wrapper-file="page-home.php" data-motopress-wrapper-type="content">
                <div class="row">
                    <div class="<?php echo apply_filters( 'cherry_home_layout', 'span12' ); ?>" data-motopress-type="static" data-motopress-static-file="static/static-slider.php">
                        <?php get_template_part("static/static-slider"); ?>
                    </div>
                </div>
                <div class="row">
                    <div class="<?php echo apply_filters( 'cherry_home_layout', 'span12' ); ?>" data-motopress-type="loop" data-motopress-loop-file="loop/loop-page.php">
                        <?php get_template_part("loop/loop-page"); ?>
                    </div>
                </div>
            </div>
            <?php do_action( 'cherry_after_home_page_content' ); ?>
        </div>
    </div>
</div>

<?php get_footer(); ?>

我已经解决了这个问题,所以仅供遇到同样问题的任何人使用。

"cherry_after_home_page_content"与它无关。 (实际上我后来注意到,在我上面粘贴的代码中,我不小心将我粘贴的代码放到了它不属于的全角页面模板中。糟糕!)

反正就在CSS。如果您看到页脚小部件只出现在您的主页上,您的 CSS 中可能有这个:

.home .footer .footer-widgets { display:block; }

在您的子主题中,粘贴上面的代码,但将 .home 更改为您希望它显示的页面。对我来说,所有常规页面都是 .page,博客是 .blog 和 .single-post。

希望对某人有所帮助!