1

I am using Cherry Framework. Now I would like to customize this theme. I would like to push some HTML in to footer.php. I got below code in footer.php.

<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the #content div and all content after
 *
 */
        do_action( 'cherry_footer_before' );

        do_action( 'cherry_footer' );

        do_action( 'cherry_footer_after' ); ?>

    </div><!--site-wrapper-->

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

<?php wp_footer(); ?>
</body>
</html>

Now how can I push HTML code in this file ?

What is the meaning of do_action( 'cherry_footer_before' );?

Where can I get the HTML code of this footer ??

1

do_action(); creates an action hook which we can use to hook our function in function.php file.

in the above code, 4 action hooks are defined

cherry_footer_before
cherry_footer
cherry_footer_after
cherry_body_end

if you go to theme-folder/lib/structure.php you wil see three action hooks.

add_action( 'cherry_footer_before', 'cherry_footer_wrap',    999 );
add_action( 'cherry_footer_after',  'cherry_footer_wrap',      0 );
add_action( 'cherry_footer',        'cherry_footer_load_template' );

and you can see these function on the same file.

function cherry_footer_wrap() {

    if ( ! did_action( 'cherry_footer' ) ) {
        printf( '<footer %s>', cherry_get_attr( 'footer' ) );
    } else {
        echo '</footer>';
    }
}


function cherry_footer_load_template() {
    get_template_part( 'templates/wrapper-footer', cherry_template_base() );
}

now you can see in the above function, template part is called. which is inside theme-folder/templates/wrapper-footer.php.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.