Archived topic
Remove "copyright-bar" div
8 replies · Started by Dan on March 15, 2018
Hi
I would like to remove the copyright bar, but not with "disaply:none", but rather using a function.
Is there an available filter/hook for that?
The 'tu_remove_footer' function removes the whole bottom part, and I would like to remove just the copyright DIV.
Thanks,
Dan
Found this:
https://gist.github.com/generatepress/36c0c52479679252af28
Which removes the actual content but doesn't remove the "copyright-bar" div.
Maybe adding a checkbox in the customizer: "Remove copyright" could also do the job?
Thanks,
Dan
Hi Dan,
Is this the snippet you've tried?
add_action( 'after_setup_theme','tu_remove_footer' );
function tu_remove_footer() {
remove_action( 'generate_footer','generate_construct_footer' );
}
It should only remove the copyright bar and nothing else.
Hi Leo, thanks for replying,
Yes, I've tried that snippet which removes "footer-bar" div, I have a few links in there that I want to keep.
I just wanted to completely remove the "copyright-bar" div, which is the div under the "footer-bar"
Dan
Unfortunately that div can't be removed without removing the entire footer: https://github.com/tomusborne/generatepress/blob/2.0.2/inc/structure/footer.php#L33-L44
You could remove the footer, then add your own footer with the data you need?
Let me know :)
Thanks Tom,
So I'll use this snippet:
add_action('after_setup_theme','generate_copyright_remove_default_message');
function generate_copyright_remove_default_message()
{
remove_action( 'generate_credits', 'generate_add_footer_info' );
remove_action( 'generate_copyright_line','generate_add_login_attribution' );
}
It removes the content, not the DIV itself. I can live with that :-)
Thanks
Dan
No problem, glad you found something that works :)
Just a quick note, I added this to functions.php and it killed the black bar entirely, as I wanted:
// make entire black bottom footer copyright bar disappear
function generate_construct_footer() {}
I don't suggest that method. Instead, I would do this:
remove_action( 'generate_footer', 'generate_construct_footer' );