• Resolved f.perez87

    (@fperez87)


    Hello, thank you very much for your plugin, it has been very useful though I having some trouble using it. I’ve got 4 questions:

    1) I would like to see the user’s name in the upper right corner, in the header. For that I need to get the user’s name at header.php file. How can I do that?
    2) Do you have a boolean variable to see if there is any user logged in?
    3) Can I show different menus depending if there is a user logged in or not?
    4) Is there a way of creating a database (exportable to MS Excel) with the users information?

    Thank you very much! Hope you can help me!

    https://wordpress.org/plugins/front-end-only-users/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Rustaurius

    (@rustaurius)

    Hi FPerez,

    For your first three questions, check out the FEUP_User class, in the file “Public_Functions.php”. You should be able to do all three of those things using that class.

    For the fourth question, not at this time. We’re working on adding new features, working through some bugs, and expanding the documentation, that we’re hoping to put out over the course of this month.

    Hello f.perez87

    Maybe this will help you more not needing to search within the class.

    1. After you decide where in your header.php file you want to place that name you just need to write this code.
    Welcome, <?php echo do_shortcode('[user-data field_name="The name of your name field"]'); ?>

    2. Yes, they have one. If you want to use it on header.php for example to know where to show that welcome message. Just make a check after loading the needed class like this.

    <?php
        $User = new FEUP_User();
        if( $User -> Is_Logged_In() ):
            show the welcome message
        else:
            show the login button
        endif;
    ?>

    3. You can obtain the same menu things based on the check above if a user is logged in or not.

    Hope this helps, and I hope you don’t mind Rustaurius that I gave a more elaborate answer on this 🙂

    Plugin Author Rustaurius

    (@rustaurius)

    Hi StK,

    Don’t mind at all, thrilled actually. We’re trying to clean up some of the errors and starting to work on new features, so if you have solutions to any other small errors or user’s questions, the help is very appreciated.

    Thread Starter f.perez87

    (@fperez87)

    Thank you both for your help, sorry I did not reply before, I haven’t been working on my website for the las couple of months. I have a few more questions:

    1. about previous question n3 (different menu for logged in users). I still haven’t found the way to show a different menu. I have created 2 menus at appearance/menus but my main menu is the one that is always shown. I dont understand how to point to one menu or the other.

    2. about question n2, is there anything I’d need to change of the code StKwarrior gave me or is it only copy/paste??

    Welcome, <?php echo do_shortcode(‘[user-data field_name=”The name of your name field”]’); ?>

    Thank you!

    Thread Starter f.perez87

    (@fperez87)

    question number 3 is solved, I still need some help with different menus! Hope you can help. Thanks!

    Plugin Contributor etoilewebdesign

    (@etoilewebdesign)

    Hi f.perez,

    I think that the code that StK provided should work well. You could want to do the same thing for the menus as well; if the user is logged in (checked using the code provided by StK), display one menu, else, display the other menu.

    Thread Starter f.perez87

    (@fperez87)

    Thank you very much, I’ll give it another try!

    pmkr

    (@pmkr)

    Argh! I want to use this in my custom template.
    (plain [restrict][/restrict]
    Can I add the function to template page? so that the page and header will be restricted for everyone but logged in users – and the content of the page I can restrict from other users than one level straight from the post.
    [restricted level=’3′] etc.. [/restricted]

    The problem is that in my custom template there is nothing but

    <?php

    get_template_part(‘single’);?>

    so How can I add that to a $string?

    Plugin Author Rustaurius

    (@rustaurius)

    Hi pmkr,

    There should be another folder in your theme that contains the template parts, in that case. You would need to find whatever is returning the template part labelled “single” in your theme folder, and then add the code into that.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘some questions’ is closed to new replies.