【发布时间】:2017-01-30 04:12:06
【问题描述】:
我正在使用用 Cherry 框架制作的 Wordpress 模板。完整的页脚仅出现在主页上。我希望它出现在所有页面类型上,主要是“全角页面模板”。
当我查看每个模板的 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(); ?>
【问题讨论】:
标签: php wordpress templates footer