Stephanie Stephanie - 2 months ago 8
PHP Question

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

I am using a Wordpress template made with Cherry Framework. The complete footer only appears on the home page. I would like it to appear on all page types, which are mostly 'fullwidth page templates'.

When I look at the PHP files for each template, the difference I can see is this:

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


I can't seem to find where
cherry_after_home_page_content
is defined. Could this be what I'm looking for? I tried copying that into the fullwidth page template, but it doesn't work. If I'm totally off base, what would be the correct way to accomplish this?

Footer that appears on every page regardless of template type. Here is the screenshot:

Footer that appears on every page regardless of template type

Code from fullwidth page template:

<?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(); ?>


Complete footer that only appears on the home page. Below is a screenshot:

Complete footer that only appears on the home page

Code from homepage template:

<?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(); ?>

Answer

I figured this out, so just for anyone who comes across this with the same problem.

The "cherry_after_home_page_content" had nothing to do with it. (And actually I noticed afterward that in my pasted code above I accidentally put in the code where I had pasted it in to the fullwidth page template where it does not belong. Ooops!)

Anyway, it is just in the CSS. If you are seeing that the footer widgets only appear on your homepage, you probably have this in your CSS:

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

In your child theme, paste in the above code but change .home to the pages where you want it to show up. For me it was .page for all regular pages, .blog and .single-post for the blog.

Hope that helps someone!

Comments