WordPress.org

Ready to get started?Download WordPress

Forums

Theme My Login
[resolved] Theme my login and user photo conflict? (16 posts)

  1. fiobb
    Member
    Posted 3 years ago #

    Hi,
    I am using the plugin user photo and would like to use this in conjunction with a themed profile page. The problem is that when you upload a user photo, it doesn't become visible on the profile page when it is themed using either TMP or TML. Upload error messages aren't shown either, and they are shown on the regular profile page.
    Is there any way you can help, or would you recommend a different user photo plugin.

    Thanks

    http://wordpress.org/extend/plugins/theme-my-login/

  2. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    The CSS file for the userphoto plugin is not being loaded on the front-end profile page. You will need to do this manually using your theme's functions.php file. Add the following:

    function load_user_photo_css() {
        if ( is_page( 'login' ) && is_user_logged_in() )
            wp_enqueue_style( 'user-photo', plugins_url( 'user-photo/admin.css' ) );
    }
    add_action( 'wp_head', 'load_user_photo_css' );
  3. Nuwanda
    Member
    Posted 3 years ago #

    Nope, still not working, Jeff. At least not for me.

  4. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    Is the CSS file being loaded?

  5. Nuwanda
    Member
    Posted 3 years ago #

    No.

    I tried cleaning out the loading functions from the plugin file to avoid any conflicts. Still no good.

  6. fiobb
    Member
    Posted 3 years ago #

    Hi,
    It still isn't working for me either, but I don't know how to tell if the style sheet is being loaded or not.
    Thanks for your help on this.

  7. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    I will play around with "User Photo" today and see what I can figure out.

  8. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    The issue has been found and resolved in the trunk as of [286066]. However, if you wish to fix it for your current version, open up the file "theme-my-login/modules/themed-profiles/includes/template-functions.php". Look for the following at the beginning of the file:

    function wdbj_tml_themed_profiles_display() {
    	global $current_user, $action, $redirect, $profile, $user_id, $wp_http_referer;

    And simply add $profileuser to the global list, as follows:

    function wdbj_tml_themed_profiles_display() {
    	global $profileuser, $current_user, $action, $redirect, $profile, $user_id, $wp_http_referer;

    User photo will now work with themed profiles.

    If the author of "User Photo" is reading this, you should add $profileuser as a parameter to userphoto_display_selector_fieldset(), instead of declaring it globally, as it is passed into the hook precisely for this reason.

  9. Nuwanda
    Member
    Posted 3 years ago #

    Jeff, still no good.

    But I do need to confirm one thing. Your last hack stands alone, or do I still need to load the css in my functions file as you mentioned earlier?

  10. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    I've confirmed myself that this fix works. Without the CSS.

  11. Nuwanda
    Member
    Posted 3 years ago #

    Thanks for your efforts, Jeff.

    I've uninstalled User Photo and reinstalled it. Still no good.

  12. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    Did you edit the file as I said?

  13. Nuwanda
    Member
    Posted 3 years ago #

    For sure, Jeff.

    The edit was made exactly as you indicated. And a fresh install of the User Photo plugin. No other edits made.

    I'm interested to hear if fiobb has better results.

  14. Jeff Farthing
    Member
    Plugin Author

    Posted 3 years ago #

    Give me admin access to your site and I'll take a look.

  15. fiobb
    Member
    Posted 3 years ago #

    Works for me, thanks very much!!!

  16. Nuwanda
    Member
    Posted 3 years ago #

    Great to hear it's working now.

    In the meantime, I've just written a leaner user photo upload plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic