Results 1 to 2 of 2

Thread: Showing Logo Instead of Avatar on Author Page, How To Include Default Image?

  1. #1
    Thread Starter
    Senior Member edwin's Avatar
    Join Date
    Nov 2010
    Location
    Netherlands
    Posts
    117
    Thanks
    3
    Thanked 22 Times in 17 Posts

    Showing Logo Instead of Avatar on Author Page, How To Include Default Image?

    Hi,

    I've swapped the Avatar image on the author.php template with a logo display functionality.

    On the theme-profile.php page located in the includes folder I have added this snippet above the Twitter and Facebook form fields:

    Code:
    <tr>
    <th><label for="twitter"><?php _e('Logo:','appthemes')?></label></th>
    
    <td>
    <input type="text" name="logo_id" id="logo_id" value="<?php echo esc_attr(get_the_author_meta('logo_id', $user->ID)); ?>" class="regular-text" size="35" /><br />
    <span class="description"><?php _e('Enter your logo image URL - Include the http:// part in front of the url','appthemes')?></span>
    </td>
    </tr>
    and I have added the logo_id value in this code collection near the top of tpl_profile.php
    Code:
            update_usermeta($user_ID, 'logo_id', $_POST['logo_id']);
            update_usermeta($user_ID, 'twitter_id', $_POST['twitter_id']);
            update_usermeta($user_ID, 'facebook_id', $_POST['facebook_id']);
            update_usermeta($user_ID, 'paypal_email', $_POST['paypal_email']);
    And on author.php I have this line of code:

    Code:
    <div id="user-logo"><img src="<?php echo $curauth->logo_id; ?>" alt="" /></div>
    The only problem is, if there isn't a logo uploaded yet, it shows a broken image symbol for other browsers then FireFox.

    So I'm looking for a way to include a default image, that will be swapped out once there is a logo image url submitted via the Edit Profile settings.

    I would really appreciate it if someone could advise how to tackle this functionality with some code examples.

    Thanks!

  2. #2
    Thread Starter
    Senior Member edwin's Avatar
    Join Date
    Nov 2010
    Location
    Netherlands
    Posts
    117
    Thanks
    3
    Thanked 22 Times in 17 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: March 27th, 2012, 09:01 AM
  2. Showing Users Page in Root instead of /author?
    By kenhammond in forum Report ClassiPress Bugs
    Replies: 3
    Last Post: January 4th, 2011, 02:39 PM
  3. Author Page Not Showing
    By dbronco27 in forum Help Using ClassiPress
    Replies: 24
    Last Post: June 22nd, 2010, 10:49 PM