Confused while editing footer.php
-
I am currently working on the site and the theme I’m using is Interface http://themehorse.com/preview/interface/ when I went to edit the footer via footer.php, I saw that code was bit different that regular and didnt know how to delete the certain part of footer. That is what I see
<?php /** * Displays the footer section of the theme. * * @package Theme Horse * @subpackage Interface * @since Interface 1.0 */ ?> </div> <!-- .container --> </div> <!-- #main --> <?php /** * interface_business_template_ourclients hook * * HOOKED_FUNCTION_NAME PRIORITY * * interface_display_business_template_ourclients 10 */ if( is_page_template( 'page-templates/page-template-business.php' ) ) { do_action( 'interface_business_template_ourclients' ); } ?> <?php /** * interface_after_main hook */ do_action( 'interface_after_main' ); ?> <?php /** * interface_before_footer hook */ do_action( 'interface_before_footer' ); ?> <footer id="colophon" class="clearfix"> <?php /** * interface_footer hook * * HOOKED_FUNCTION_NAME PRIORITY * * interface_footer_widget_area 5 * interface_footer_infoblog 10 * interface_footer_div_close 15 * interface_open_sitegenerator_div 20 * interface_socialnetworks 25 * interface_footer_info 30 * interface_close_sitegenerator_div 35 * interface_backtotop_html 40 */ do_action( 'interface_footer' ); ?> </footer> <?php /** * interface_after_footer hook */ do_action( 'interface_after_footer' ); ?> </div> <!-- .wrapper --> <?php /** * interface_after hook */ do_action( 'interface_after' ); ?> <?php wp_footer(); ?> </body></html>
How am I suppose to edit this.
I want to remove part of the footer.
Currently it says:
Copyright © 2015 MyCompanyName | Theme by: Theme Horse | Powered by: WordPressI want it so it says:
Copyright © 2015 MyCompanyNameThanks for your help
-
It looks like the theme is adding content with custom functions and hooks. You should be able to remove the default content and then add your own through a custom function.
From a custom plugin (try Pluginception), try the following code:
/** * remove function to show the footer info, copyright information */ remove_action( 'interface_footer', 'interface_footer_info', 31 ); /** * add CUSTOM function to show the footer info, copyright information */ function sd_interface_footer_info() { $output = '<div class="copyright">'.__( 'Copyright ©', 'interface' ).' '.interface_the_year().' '.interface_site_link().'</div><!-- .copyright -->'; echo $output; } add_action( 'interface_footer', 'sd_interface_footer_info', 32 );
Actually, use this instead… a slight adjustment to make sure the original footer content is removed properly:
/** * remove function to show the footer info, copyright information */ function sd_remove_interface_footer_info() { remove_action( 'interface_footer', 'interface_footer_info', 30 ); } add_action( 'template_redirect', 'sd_remove_interface_footer_info' ); /** * add CUSTOM function to show the footer info, copyright information */ function sd_interface_footer_info() { $output = '<div class="copyright">'.__( 'Copyright ©', 'interface' ).' '.interface_the_year().' '.interface_site_link().'</div><!-- .copyright -->'; echo $output; } add_action( 'interface_footer', 'sd_interface_footer_info', 30 );
- The topic ‘Confused while editing footer.php’ is closed to new replies.