Create a hook
-
Hi guys, I am using the church theme which is a child of omega. I would like to change the footer like I have with other themes.
However, church does not use footer.php as most other themes do, it actually uses hooks.php in the parent lib directory.
I have tried and cannot get it to work. I am trying to create a hook in functions.php or even a plugin that will override the default footer text from the hooks.php to my text and not get changed back when there is an update.
The original code in the hooks.php file is:
/** * default footer insert filter */ function omega_default_footer_insert( $settings ) { /* If there is a child theme active, use [child-link] shortcode to the $footer_insert. */ return '<p class="copyright">' . __( 'Copyright © [the-year] [site-link].', 'omega' ) . '</p>' . "\n\n" . '<p class="credit">' . __( 'Theme by [author-uri].', 'omega' ) . '</p>'; } /**I want to create a hook that will replace that code with this:
/** * default footer insert filter */ function omega_default_footer_insert( $settings ) { /* If there is a child theme active, use [child-link] shortcode to the $footer_insert. */ return '<p class="copyright">' . __( 'Copyright © [the-year] [site-link] All Rights Reserved. No part of this website may be reproduced without express consent of [site-link]. <br>[site-link] is an affiliate of FFCF Ltd', 'omega' ) . '</p>'; } /**If it helps the directory for the original file is /wp/wp-content/themes/omega/lib/hooks.php and the child theme is /wp/wp-content/themes/church/
At the moment if there is an update I just change the code in the hooks.php manually, however, I would like to set it as permanent
The topic ‘Create a hook’ is closed to new replies.