Tagged: social share
hello,
all my pages are made with advanced layout builder
i have modified my child function.php to include on every footer the social sharing bar
like explained here:
https://kriesi.at/support/topic/share-icons-on-pages-and-portfolio-items/#post-260646
i want to know how to exclude a specific page to do not display the bar (like my homepage for example)
thx a lot
Fred
Hey fredengl,
You can try something like this:
add_action('ava_after_content', 'avia_add_social_toolbar', 10, 2);
function avia_add_social_toolbar($id = "", $context = "")
{
if($context == "page" || $context == "single-portfolio") {
if ( ! is_page( 42 )) {
avia_social_share_links();
}
}
}
42 is the ID of the page and the exclamation mark means not, so the code will not display on the page with ID 42. https://developer.wordpress.org/reference/functions/is_page/
Thanks,
Rikard