- This topic has 8 replies, 2 voices, and was last updated 6 years, 12 months ago by kejpa.
-
AuthorPosts
-
March 28, 2017 at 4:25 pm #113091kejpaParticipant
Hi,
I’d like to change the default footer in order to show some appreciation for our host.
I’ve looked at a previous thread here but I just can’t get the hang of it.
This is what I’ve got:/***** ** Changing the default footer ***** add_action ('catchbase_footer', 'remove_default_footer',99); function remove_default_footer(){ remove_action( 'catchbase_footer', 'catchbase_footer_content'); } */ function catchbase_asf_footer_content() { //catchbase_flush_transients(); if ( ( !$catchbase_asf_footer_content = get_transient( 'catchbase_asf_footer_content' ) ) ) { echo '<!-- refreshing cache -->'; $catchbase_content = catchbase_get_content(); $catchbase_asf_footer_content = ' <div id="site-generator" class="two"> <div class="wrapper"> <div id="footer-left-content" class="copyright">' . $catchbase_content['left'] . '</div> <div id="footer-right-content" class="powered">Works! ' . $catchbase_content['right'] . '</div> </div><!-- .wrapper --> </div><!-- #site-generator -->'; set_transient( 'catchbase_asf_footer_content', $catchbase_asf_footer_content, 86940 ); } echo $catchbase_asf_footer_content; } add_action( 'catchbase_footer', 'catchbase_asf_footer_content', 101 );
It works in the respect that I get a new footer below the default, but I’d like to remove the default footer.
I guess it’s the remove_action part that fails 🙁Any help appreciated!
/KjellMarch 29, 2017 at 1:05 am #113106MaheshKeymaster@kejpa: This feature is already included in the Pro version. I recommend you to upgrade to Pro version. Since you’ve already put up the codings, I’ll give you the simple idea.
Instead of adding and removing actions, directly override the functioncatchbase_footer_content()
through your child theme. It will work just fine.Let me know if any problem.
Regards,
MaheshMarch 30, 2017 at 4:02 pm #113211kejpaParticipantHi,
I tried to just make a duplicate of the function in my functions-file but I get a Fatal Error “Cannot redeclare catchbase_footer_content()”
I’m probably missing something basicThanks in advance!
/KjellMarch 31, 2017 at 4:09 am #113229MaheshKeymaster@kejpa: Oh sorry about that, forgot that this function can’t be override and must be replaced. Copy the original function to the child theme’s functions.php and rename the function and change the content as desired and hook it. If you are not familiar with coding, I recommend you to hire a customizer.
Regards,
MaheshMarch 31, 2017 at 4:16 am #113230kejpaParticipantHi,
no worries 😉But I still need to remove the hook to the original function. Or should I just hide it with CSS?
Appreciate your efforts!
/KjellMarch 31, 2017 at 6:56 am #113241MaheshKeymaster@kejpa: Removing the hook would be more better than just hiding it, since you are already customizing.
Regards,
MaheshMarch 31, 2017 at 1:19 pm #113265kejpaParticipantI thought so, and I made a try but it’s not working.
add_action ('catchbase_footer', 'remove_default_footer',99); function remove_default_footer(){ remove_action( 'catchbase_footer', 'catchbase_footer_content'); }
(See my first post)
April 3, 2017 at 4:48 am #113368MaheshKeymaster@kejpa: You’ll need to call the
add_action
in init hook. I hope you understand.Regards,
MaheshApril 3, 2017 at 2:25 pm #113401kejpaParticipantYeah, I got it working. Finally 🙂
Thanks a lot for your efforts
/Kjell -
AuthorPosts
- The topic ‘Changing the default footer’ is closed to new replies.