This topic has 1 reply, 2 voices, and was last updated 7 years by Kieran_SQ.

  • Author
  • #168319
     dynamus
    Participant

    Hi,

    I would like to offer when a client logs on the intranet our native mobile app if BuddyApp detects that the client is mobile.

    fyi: Our network is 100% private.

     

    How could I do that ? ( I program a little)

    Samples are best for me. If the sample could be a beautiful one, better.

     

    Many thanks,

    Jr.

     

    #168321
     Kieran_SQ
    Moderator

    Hi @dynamus,

    There would be several ways to do this, the simplest would be to use is_user_logged_in() with wp_is_mobile(). This will check first if the user is logged in and secondly if they’re on a mobile device. See here https://developer.wordpress.org/reference/functions/is_user_logged_in/ and here https://codex.wordpress.org/Function_Reference/wp_is_mobile for examples about these two functions.

    Depending on what you wanted to do you could either force a redirect or simply show content specific to those two conditions using theme hooks, see here for information about theme hooks https://archived.seventhqueen.com/documentation/buddyapp#hooks.

    An example of using the theme hooks would be something like

    COPY CODE
    // Check if user is logged in and on mobile if they are add content before content
    add_action('kleo_before_content','check_mobile_logged_in');
    function check_mobile_logged_in() {
        if ( is_user_logged_in() && wp_is_mobile() ) {
            echo do_shortcode('[SHORTCODE HERE]');
        }
    }

    Or

    COPY CODE
    // Check if user is logged in and on mobile if they are add content before content
    add_action('kleo_before_content','check_mobile_logged_in');
    function check_mobile_logged_in() {
        if ( is_user_logged_in() && wp_is_mobile() ) {
            echo 'My text or HTML here';
        }
    }

    Hope this helps,

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Ticket solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?