Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #113091
    kejpa
    Participant

    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!
    /Kjell

    #113106
    Mahesh
    Keymaster

    @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 function catchbase_footer_content() through your child theme. It will work just fine.

    Let me know if any problem.

    Regards,
    Mahesh

    #113211
    kejpa
    Participant

    Hi,
    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 basic

    Thanks in advance!
    /Kjell

    #113229
    Mahesh
    Keymaster

    @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,
    Mahesh

    #113230
    kejpa
    Participant

    Hi,
    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!
    /Kjell

    #113241
    Mahesh
    Keymaster

    @kejpa: Removing the hook would be more better than just hiding it, since you are already customizing.

    Regards,
    Mahesh

    #113265
    kejpa
    Participant

    I 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)

    #113368
    Mahesh
    Keymaster

    @kejpa: You’ll need to call the add_action in init hook. I hope you understand.

    Regards,
    Mahesh

    #113401
    kejpa
    Participant

    Yeah, I got it working. Finally 🙂

    Thanks a lot for your efforts
    /Kjell

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Changing the default footer’ is closed to new replies.