• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
Callia Web

Callia Web

Websites - Design with Purpose

  • Home
  • Websites
  • Support
  • Our Work
  • About
  • Contact

Add content before footer widgets wrap closure

14 Nov 2014

To give you extra flexibility with styling your child theme the Genesis Framework gives us Structural Wraps which you can add support for using the code:

add_theme_support( 'genesis-structural-wraps', array( 'header', 'nav', 'subnav', 'site-inner', 'footer-widgets', 'footer' ) );

But every now and then you want to add something between the wrap and the code you are wrapping.

In this case we wanted to add a div directly after the 3 footer widgets before the closing wrap </div>, see the image below for our desired markup.

Add a div to the code

A look in the genesis/lib/structure/footer.php file where the genesis_structural_wrap is defined showed that there is a filter we can use:

$output = apply_filters( "genesis_structural_wrap-{$context}", $output, $original_output );

In our case the {context} is ‘footer-widgets’ so we can do an add_filter to genesis_structural_wrap-footer-widgets – yes it is important that those hypens at the end are hypens and not underscores.

The $original_output is a little misleading, as it stores whether we are opening or closing the wrap identified by the strings ‘open’ and ‘close’. Using this to target only the closing case, we set about adding our content to $output, which we duly return.

This was just a test so our code creates just a simple div but you could add whatever you need here.

Please note, that I’ve been reliably informed by @GaryJ that this will only work in Genesis 2.1 or later.

You can also see this code on github.

add_filter( "genesis_structural_wrap-footer-widgets", 'jmw_filter_footer_widgets_structural_wrap', 10, 2);
/**
* Filter the footer-widgets context of the genesis_structural_wrap to add a div before the closing wrap div.
*
* @param string $output The markup to be returned
* @param string $original_output Set to either 'open' or 'close'
*/
function jmw_filter_footer_widgets_structural_wrap( $output, $original_output ) {

    if( 'close' == $original_output ) {
        $output = '<div>Your text here</div>' . $output;
    }
    return $output;
}

Featured Image: Photo by Alex Smith on Unsplash

Share this post:

Share on FacebookShare on LinkedInShare on E-mailShare on WhatsApp

About Jo Waltham

Jo Waltham is the founder of Callia Web and is passionate about helping people with their websites.

Liked this post? Subscribe to get our next post direct to your inbox.


Previous Post:Sourdough Bread Making CoursesRunner up in Best Cookery School Website competition
Next Post:How to add a category page title before postsBooks on a white shelf

Reader Interactions

Comments

  1. Ronald

    26 Nov 2016 at 10:59 am

    Hello Jo,

    Thanks for this tutorial. However, I want a customize text below footer-widget but above wrap. How can I do that?

    I will wait for your response. Thanks! – Ronald

    Reply
    • Jo Waltham

      26 Nov 2016 at 3:50 pm

      Hi Ronald

      In the conditional change the ‘close’ to ‘open’ to target when this filter is called when the footer-widgets markup is opened.

      Jo

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Ready to get started?

Get in touch

Ask Callia Web’s AI

Contact us

Telephone: 01672 666001

Email: hello@calliaweb.co.uk

Quick links

Websites

Our work

Testimonials

About

Blog

Popular posts

Using headings in WordPress

Accessibility basics

Image sizes and aspect ratios

Making images equal size

Beginner’s guide to Analytics

Legal

Privacy policy / Cookie policy

Terms of service

Company number: 08316519

Registered address: Bowman House, Royal Wootton Bassett, Wiltshire, SN4 7DB

Copyright © 2025 · Callia Web Ltd · All Rights Reserved