• Resolved binutz

    (@binutz)


    Hi Srumery,
    Thanks for this wonderful plugin.
    It works well with my site.The only problem that i have is that it shows up on all pages. I would like to have it displayed only on my home page.

    I am using SSTab to redirect visitors to an inner page.
    (I found your code for conditionally turning off SST on Home page in FAQ section ,but I do not know how to edit it )
    Please help.

    Regards

    Binu

    https://www.ads-software.com/plugins/simple-side-tab/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter binutz

    (@binutz)

    Hi Srumery.
    I found the code for showing SST only on home page , in one of your past support threads. Sorry for bothering you.

    I am adding it here to help other users who are looking for the same function.
    Thanks & regards

    Binu

    // filter the tab display value to conditionally turn off the tab
        function rum_filter_simple_side_tab_display( $display ) {
    
            if ( ! is_front_page() ) {
    
                $display = false;
            }
    
            return $display;
        }
        add_filter( 'rum_sst_plugin_display_tab', 'rum_filter_simple_side_tab_display', 10 , 1 );
    Plugin Author srumery

    (@srumery)

    Hey, you found the answer to your question. Thank you for providing it here as well, binutz.

    There are also a couple more snippets of code on the FAQ page.

    https://www.ads-software.com/plugins/simple-side-tab/faq/

    Cheers!

    Is there a way to configure this so that the side tab displays only on one specific page? For example, I have a product page and I want to link to an order form specific to that product. I don’t want the tab to appear on unrelated pages though. Thanks for any help you can provide.

    Dave

    Plugin Author srumery

    (@srumery)

    You might give this a shot, @blobsterman. Find the ID of the page you want to display and replace “42” in the code below with the ID of your page.

    // filter the tab display value to conditionally turn off the tab
    function rum_filter_simple_side_tab_display( $display ) {
    
        // turn off the tab    
        $display = false;
    
        // conditionally turn it on
        if ( is_page( 42 ) ) {
    
            $display = true;
        }
    
        return $display;
    }
    add_filter( 'rum_sst_plugin_display_tab', 'rum_filter_simple_side_tab_display', 10 , 1 );

    Brilliant, thanks so much.

    I’m trying to conditionally turn off the simple side tab on one page, but I’m no code expert. How do I do this?

    Plugin Author srumery

    (@srumery)

    @spowers, give this a try…

    Simply replace “42” with the id of the page you do not the tab displayed.

    // filter the tab display value to conditionally turn off the tab
    function rum_filter_simple_side_tab_display( $display ) {
    
        // conditionally turn off the tab
        if ( is_page( 42 ) ) {
    
            $display = false;
        }
    
        return $display;
    }
    add_filter( 'rum_sst_plugin_display_tab', 'rum_filter_simple_side_tab_display', 10 , 1 );

    Where do I add these code snippets – within what file?

    Plugin Author srumery

    (@srumery)

    Most people add it to the functions.php file in their theme. Some create site specific plugins and put the code in there. Either way works well.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Wants tab to be shown only home page’ is closed to new replies.