Home Forums Plugin Support WP User Frontend Pro How to show Registration/Edit Profile form in author.php

This topic is: resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Tareq Hasan 5 years, 11 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5883

    inka
    Participant
    Post count: 4

    Hi, i just installed the WPUF plugin and i'm having some trouble getting it to work as i imagined.

    I have a Registration/Edit Profile form set up and included the shortcode into a page. When i view the page it works perfectly. Now what i want to do though is to show that page in author.php, so that whenever a user is looking at the archive of his own posts, he also has the possibility to edit his profile.

    Here's the code that i'm using for showing the page in author.php:

    <?php
    if ( get_the_author_meta('ID') == get_current_user_id()) {
       $profile = get_post(204); //the page with the shortcode of the form
       echo apply_filters('the_content', $profile->post_content);
    }
    ?>

    This does show the page and the included form, however the form doesn't seem to work the way it does when i just view the page itself. It is not styled the way it is when i view the single page, the avatar-upload that is part of the form produces a javascript error (“ReferenceError: WPUF_Uploader is not defined”), the user profile is not updated when i submit the form, and it doesn't redirect me back to the author archive after submitting the form (it shows the 404 page instead).

    Can you give me a hint what i'm doing wrong? I also thought about including the form directly with do_shortcode() – would that be a better way to do it?

    I'm using a modified twentytwelve theme without any other plugins.

    Please, let me know if you need further details…
    Thank you!!

    #5892

    Tareq Hasan
    Keymaster
    Post count: 2831

    The way you are following, that would work. But in the latest update of the plugin, all the scripts/styles are only added/enqueued to the page if the shortcode is present on the post. As you are using the form/shortcode in the author page, so it can't check there and as a result you don't get any js/css in that page from the plugin.

    The same problem you are facing is also reported by another user. So the best way would be let you choose via an option to add/enqueue the js/css in every pages or in the specific page where the shortcode exists. I'll update the plugin with an option for switching the setting and let you know. That would solve your problem.

    #5900

    inka
    Participant
    Post count: 4

    Thanks! That would be great!
    I will link to the normal static page in the meantime…

    #6007

    inka
    Participant
    Post count: 4

    I found a solution in this post: http://wedevs.com/support/topic/registration-form-_wp_http_referer/

    Followed the suggestions there to switch of the if condition that checks if shortcode is present before it includes the scripts/css. So the plugin now loads the scripts/css on every page. Works perfectly now!

    Thanks again! Great plugin!

    #6022

    Tareq Hasan
    Keymaster
    Post count: 2831

    In the latest update 2.1.7, you can turn on/off the scripts loading from the plugin settings ๐Ÿ™‚

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

The topic ‘How to show Registration/Edit Profile form in author.php’ is closed to new replies.