• Resolved Quibby

    (@quibby)


    Hi,

    I am working on a listing website where content is generated by user and listing is published without moderation. There are posts from certain categories which i do not need AddToAny, is there a way to prevent AddToAny from attaching to these posts under these certain categories? I know one could manually remove from admin dashboard, but is there a way to make it auto removed from posts of certain categories?

    Thanks!

    https://ww.wp.xz.cn/plugins/add-to-any/

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

    (@micropat)

    See “How can I programmatically remove the button(s)?” in the plugin’s FAQ:
    https://ww.wp.xz.cn/plugins/add-to-any/faq/

    Thread Starter Quibby

    (@quibby)

    Thank you, micropat.

    I am trying to disable for ad listings under a particular ad category/subcategory, I suppose I should be looking at How to disable sharing on custom post type? Only because I tried the disable sharing on categories and that didn’t work for me; is it because the categories here are for categories in blog posts? So if my post type is ad_listing, and I like to disable only for all the ad listings from a subcategory ‘private_collection’ under the category ‘collectibles’, how could I do that?

    Thanks!

    Plugin Author micropat

    (@micropat)

    If it’s a custom post type, there should be a checkbox for that post type under “Placement” in AddToAny settings.

    Thread Starter Quibby

    (@quibby)

    Thanks… I tried that too but then it turns off the sharing for all the ad listings, all types… I would like to turn it off for only some selected categories or subcategories from among the list of other categories for the ad listing posts. For example, a user can post an ad in one of several categories, A/B/C/D etc, and say I like all the ads to have sharing except for the category D, is there a way to turn if off for this category D only?

    Plugin Author micropat

    (@micropat)

    In that case, do it programmatically per the FAQ. Something like this in your theme’s functions.php:

    function addtoany_disable_sharing_for_ads_in_some_category() {
        if ( in_category( array( 'private_collection' ) ) && 'ad_listing' == get_post_type() ) {
            return true;
        }
    }
    add_filter( 'addtoany_sharing_disabled', 'addtoany_disable_sharing_for_ads_in_some_category' );
Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remove Share button from certain type of Posts’ is closed to new replies.