• Resolved biaf

    (@biaf)


    good evening, in the settings I saw that you may not display the bar on certain pages, however when you have a lot of pages on the site it takes too long to fill in the page id. do you have a solution so that the bar is only displayed on a single page (the homepage) and not on all the pages.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Lap

    (@lapzor)

    You can do that with some custom code.

    add_filter( 'mctb_show_bar', function( $show ) {
        return is_home();
    } );

    I recommend using https://www.ads-software.com/plugins/code-snippets/ to add custom code to your site.

    Hope that helps. If you have any questions, please let me know!

    Thread Starter biaf

    (@biaf)

    with this code it allows to display the bar only on the home page? on the other hand I do not see where to put the id of the home page so that I tell the code to display the bar only on this page. Thank you very much for your help

    Plugin Contributor Lap

    (@lapzor)

    If that functions returns “true” it will show the top bar, if it returns “false” it won’t.

    In this case it’s doing return is_home();

    and “is_home()” returns true if it’s the homepage, otherwise it doesn’t.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘display the bar on a page’ is closed to new replies.