• Resolved Eric Karkovack

    (@karks88)


    Hi, I’m using the addtoany_sharing_disabled filter to hide the floating bar on pages (I just want to display it on posts). However, I’m finding that I can’t get it also hide on archive or category pages.

    Here’s the code I’m using:

    function addtoany_disable_sharing_on_my_custom_post_type() {
        if ( is_page() || is_archive()  || is_category() ) {
            return true;
        }
    }
    add_filter( 'addtoany_sharing_disabled', 'addtoany_disable_sharing_on_my_custom_post_type' );

    Any ideas on why this doesn’t work? I double checked the back end settings for the plugin and it’s not set to show anywhere.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author micropat

    (@micropat)

    Hi Eric, thanks for posting — you found a bug! Right now the addtoany_sharing_disabled filter only applies to singular posts, so that’ll be fixed in the next plugin release.

    In the meantime, you can hide the floating bar(s) on non-singular posts by adding a line of CSS code to your “Additional CSS” box in AddToAny Settings:

    body:not(.single-post) .a2a_floating_style { display: none; }

    Thread Starter Eric Karkovack

    (@karks88)

    @micropat Thanks for your help! And glad I could help spot the bug ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Floating Bar on Archive Pages’ is closed to new replies.