• Resolved sejpal.nirali

    (@sejpalnirali)


    Hello,
    I have made one custom plugin for multisite. In which i want to check that if particular page is ‘home page’ of site then one popup will show on site. But for that i am not getting how would i come to know about in plugin code that particular page is home page or not.

    For that i have also used concept of SESSION in wp_settings.php file.
    But it is not working right now for multisite.
    Any help will be appreciated.
    Thanks in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter sejpal.nirali

    (@sejpalnirali)

    I have add following code in wp_settings.php to check whether the page is home page or not in multisite.

    if(is_home() || is_front_page())
    $_SESSION[‘home_page’] = ‘yes’;
    else
    $_SESSION[‘home_page’] = ‘no’;

    and following is plugin code:

    if((trim($_SESSION[‘home_page’]) == “yes”) && $home_status)
    {
    add_filter(‘wp_footer’, ‘wcg_constant_contact’);
    }

    But, every time i am getting “no” as session variable value.

    So, basically i need help to find out homepage in multisite.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    That shouldn’t be in wp_settings.php

    You should make an mu-plugin for this.

    Thread Starter sejpal.nirali

    (@sejpalnirali)

    Thanks for your replay @ Mika Epstein.

    Can you suggest how can i make code for that mu-plugin.??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    https://codex.wordpress.org/Must_Use_Plugins

    Think of them like functions files for plugins 🙂

    Thread Starter sejpal.nirali

    (@sejpalnirali)

    @mika Epstein … Thanks for sharing your ideas. It will be help full to me at some instance in coading. 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to maintain Session in multisite in wordpress’ is closed to new replies.