• Resolved litbes

    (@litbes)


    Thank you for creating a great plugin!

    I want to display the tab only on the main page of the site.
    I used the code specified on this page.
    After adding the code to function.php of my theme, a critical error occurs on my site.

    Can you tell me, what I’m doing wrong?

    Sincerely, admin

    The page I need help with: [log in to see the link]

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

    (@srumery)

    Hello @litbes,

    I’m happy to help you out. That page has a few snippets of code on it and some from other sources. Which code snippet did you add to your functions.php file? I will test it on my end and reply with a resolution for you.

    Thread Starter litbes

    (@litbes)

    Thank you for responding quickly!
    I used the code, that you approved for another user:

    // 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)

    I am not at my local development machine so I can not test that code out right now but I can see very clearly that the last “}” is not needed. That is likely the cause of the PHP error. Remove that and give it another go.

    Thread Starter litbes

    (@litbes)

    I tried without the last bracket “}” – the result is excellent!
    Now everything works as it should.
    I will gladly give five stars to your plugin!
    This is great!

    Plugin Author srumery

    (@srumery)

    Great! I am happy we got it working for you.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying the tab only on the main page’ is closed to new replies.