• Resolved Renan Bernordi

    (@altendorfme)


    Hi,

    Is it possible to disable advertising in just one story?

    Even if it is through a function/filter/actions and custom fields?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Luckyna San

    (@luckynasan)

    Hello @altendorfme , there isn’t a direct setting in the Web Stories plugin itself for disable ads on just one story. I suggest asking your web?developer?or hosting provider for assistance in implementing custom codes to disable a single web story ad.

    Thread Starter Renan Bernordi

    (@altendorfme)

    I know there is no specific option, but I am looking for help to tell me which filter, action I could work with to disable this option when necessary.

    Plugin Author Pascal Birchler

    (@swissspidy)

    Here is an example code snippet to give you an idea how to disable ads for a specific story:

    add_action(
    'web_stories_print_analytics',
    static function () {
    $current_post = get_post();

    if ( $current_post->ID === 123 ) {
    add_filter(
    'pre_option_web_stories_ad_network',
    static function () {
    return 'none';
    }
    );
    }
    },
    5
    );
    Thread Starter Renan Bernordi

    (@altendorfme)

    Perfect! Thanks! ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.