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

    (@webtoffee)

    Hi @marsvieyra,

    You can use the code snippet below to show the banner only in selected pages. Please use the right page slugs in the code and copy the code to your active theme’s functions.php

    add_filter('cli_show_cookie_bar_only_on_selected_pages', 'webtoffee_custom_selected_pages', 10, 2);
    function webtoffee_custom_selected_pages($html, $slug) {
        $slug_array = array('sample-page', 'sample-page-2');
        if (!in_array($slug, $slug_array)) {
            $html = '';
            return $html;
        }
        return $html;
    }
    Thread Starter marsvieyra

    (@marsvieyra)

    thanks!!! works like a charm ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display only on specific page?’ is closed to new replies.