• Hi,

    First of all, thanks for writing this plugin! It seems to be just what I needed! However, I’m having a bit of a problem. Maybe I’m being stupid, but I don’t understand how this plugin works. I followed the installation instructions, upload the plugin and activate it, but the plugin didn’t generate any front-end pages for me. Now I can’t find any documentation on how to go about actually generating the front-end registration, login and edit profile pages.

    I would really appreciate some advice ??

    Thanks in advance!

    https://www.ads-software.com/extend/plugins/front-end-users/

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

    (@tombenner)

    Apologies–I’ve been meaning to write some more in-depth documentation on this, but haven’t had the time yet.

    After activating the plugin, there should be an edit profile page at “https://mysite.com/profile”. (In case it’s not clear, this page isn’t a Page with a capital P, but rather a PHP file at front-end-users/views/settings.php, so that it’s easier to customize its code.)

    To make it easier to modify the login and registration pages so that they look more like the rest of the front-end site, Front-End Users provides three helpful functions that you’ll want to define in your theme’s functions.php: feu_login_head_element(), feu_login_header(), and feu_login_footer(). The functions will output content in, respectively, the login and registration pages’ <head> element, closely after their opening <body> tag, and closely before the closing </body> tag. This would allow you to add, for example, CSS into the <head> element to style to login and registration pages, a nav menu after the <body>, and a footer nav menu before the closing </body>.

    One way to do this is to logically group the contents of your theme’s header.php and footer.php into different files (e.g. move the <meta> tags from header.php into includes/header-meta.php, move the content after the opening <body> tag into includes/header-content.php, etc). You can then include each of the these includes/ files in both the appropriate Front-End Users function and in either header.php or footer.php. Here’s an example of what the three functions might look like:

    global $theme_path;
    $theme_path = get_theme_root().'/'.get_template().'/';
    
    function feu_login_head_element() {
    	global $theme_path;
    	require $theme_path.'includes/header-title.php';
    	require $theme_path.'includes/header-meta.php';
    	require $theme_path.'includes/header-css.php';
    	require $theme_path.'includes/header-js.php';
    	wp_head();
    }
    
    function feu_login_header() {
    	global $theme_path;
    	require $theme_path.'includes/header-content.php';
    }
    
    function feu_login_footer() {
    	global $theme_path;
    	require $theme_path.'includes/footer-content.php';
    	wp_footer();
    	require $theme_path.'includes/footer-js.php';
    }

    This example is taken from front-end-users/example_hooks.php, which also shows some other useful hooks that Front-End Users provides.

    Please let me know if any of this is unclear. This all unfortunately requires a little familiarity with PHP, but there really didn’t seem to be a simpler way to do it.

    Best,
    Tom

    Thread Starter salomon.meij

    (@salomonmeij)

    Tom,

    Thanks for the detailed write-up. I’ll try to get it working. I’m not that familiar with PHP, so it’s all quite confusing for me, but I’ll see if I can get it to work.

    Thanks again,

    Salomon

    Hi Tom,

    I’ve installed this plugin, and can see the front-end registration, when I go straight to the URL, but after users login they are directed straight to /wp-admin/. Do you know how I can make the login page direct straight to your form? Thanks!

    Best,
    Emily

    Also, is there a way to add a “log-out” feature to the front-end page?

    Plugin Author tombenner

    (@tombenner)

    Hi Emily,

    I’ve actually been meaning to add a setting in this plugin that lets you set what page the user should be sent to after logging, but haven’t had the time yet. I’m not sure how soon I’ll be able to add it, but I can let you know when I do.

    In the meantime, though, you might try using a plugin dedicated to this, such as Peter’s Login Redirect, which would hopefully work in concert with this plugin, but I haven’t tested it.

    The code for a logout link would be:

    <a href="<?php echo wp_logout_url(); ?>" title="Sign out">Sign out</a>

    Or, you can use one of the functions that Front-End Users provides to display a set of links like “Sign in | Register”, “John | Sign out”, or “John | Dashboard | Sign out”, depending on whether the user is logged in and has access to the admin section:

    <?php echo feu_user_header_links(); ?>

    To add one of these to only the user settings page, you would add the above code to front-end-users/views/settings.php, perhaps above the line with <?php feu_box_(); ?>.

    To add one of these to the header of every page on the site, you would add the code to the file named header.php in your theme.

    And, of course, If any of this seems unclear, or if you need any more detail, please let me know.

    Best,
    Tom

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: Front-End Users] More descriptive installation instructions?’ is closed to new replies.