• Hello, I’m trying to disable AddToAny sharing in category “Users” on my site. I’m adding code:

    function addtoany_disable_sharing_in_some_categories() {
        if ( in_category( array( 'users' ) ) ) {
            return true;
        }
    }
    add_filter( 'addtoany_sharing_disabled', 'addtoany_disable_sharing_in_some_categories' );

    What am I doing wrong?

    https://www.ads-software.com/plugins/add-to-any/

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

    (@micropat)

    The code is perfect. It disables the Standard buttons and Floating bars on singular posts that belong to the categories specified in the filter.

    It doesn’t apply to buttons manually inserted via shortcode, widget or hardcoded.

    It currently doesn’t apply to the Floating bar on the category archive page itself (example.com/category/users/). To disable the Floating bar on a specific category archive page, the current workaround is to use CSS (where 42 is a specific category ID #):
    body.category-42 .a2a_floating_style { display: none; }

    I would like to show only one of array of icons in some categories, not both below or above.

    It looks very annoying when there is not much text.
    You can see the example https://www.kilsanblog.com/mimarlik-insaat-filmler-kitaplar/mimari-fimler-insaat/bir-millik-gokdelen/

    I mean pages of a specific category

    I tried this and variations
    body.category-40.single-post .addtoany_share_save_container .addtoany_content_top { display: none; }

    didn’t worked ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable AddToAny sharing in specific categories’ is closed to new replies.