Support

Account

Forum Replies Created

  • It seems to be only half solved. Images display correctly on front-end profiles EXCEPT for profiles whose users have yet to create a post or page. If a user hasn’t created a post or page, the images they upload to their back-end profiles will not display on their front-end profiles.

  • I finally resolved this. Elliott had given me the correct direction but being limited in my php ability I failed to see my obvious mistake. The correct code can be found in the Documents HERE at the bottom of the page.

    Basically it shows an example of displaying a custom field named “author_badge” which means all you have to do is replace author_badge with your actual custom field name. I only replaced it in the places where “author_badge” appeared in orange type. I finally replaced all instances of author_badge with my own image name and voila, the picture appeared.

    Hopefully this helps other script kiddies. Thank you, Elliot for an amazing plugin.

  • Yes, I had it set to “image url”. I first had it set to “Image Object” then “image url”. Neither worked. I just tested “Image ID” and that didn’t work either. 🙁

  • Text fields are displaying if there’s text data for that field. I used your script you just posted and that didn’t work. I’m still getting

    <img src="" alt="" />

    when I view page source. All the fields display as they should except Images. I don’t know why I’m having a problem with this.

  • No. I’ve also tested additional image field names that I created. They don’t work either. If you want, you can take a look at the page in question:

    http://www.choochooclan.com/surrogate/

    user: debx
    pass: 1

    When you log in you’ll be taken directly to the user edit profile page. The You’ll have to scroll down and then select the Photographs link from the nav menu on the left to find the Add Image buttons. Simply add some images if you want and update. Then scroll back to the top of the page and click on “View my profile”. That will take you to the front-end profile page where you can check out the page source. Some of the pictures should show up at the top but as you can see, they don’t.

  • Nohl. I don’t see what you’re referring to. I did look at the source code and the answer would be no, it isn’t filling in any field, not even an incorrect path to the file. This is all that gets returned:

    <img src="" alt="" width="200" height="60" />

  • Hi, I’ve debugged using

    
    ini_set('display_errors', 'On');
    error_reporting(E_ALL | E_STRICT);
    

    I also made sure to remove all other code and only run this code that I got from ACF’s knowledge base:

    `
    $author_id = get_the_author_meta( ‘ID’ );
    $author_badge = get_field(‘imagex’, ‘user_’. $author_id ); // image field, return type = “Image Object”
    `
    ?>
    ” alt=”<?php echo $author_badge[‘alt’]; ?>” width=”200″ height=”60″ />
    `

    Debugging the code turned up nothing. My sample page is here: http://choochooclan.com/surro-test/?author=5

  • Jonathan, saving data to a cookie I believe only half solves the problem. Although the data would be saved, it wouldn’t actually be saved to the database. Given the size of my form, I was hoping that I could get the form to automatically save the data already entered into the database during timed intervals and without a refresh of the page. This is probably something that would require Ajax but is outside the realm of my abilities. Was just hoping someone already had a solution.

  • Jonathan, Thanks for responding. This plugin would have been more ideal if I had more control over placement and look of the fields. It seems it will be impossible to integrate the user profile form into a theme even if I implemented the form on the front end. This is certainly a setback as far as using this plugin further.

  • We’re you able to make any headway on this?

  • I went ahead and did it. I Imported an XML file of a large field group back to the same site I had just exported it from but only after editing the XML file, changing the null values of the Select fields and fmaking some field name changes.

    I am happy to report that importing the updated XML file updated the fields with the new field names and new null configurations. This did not cause any loss in data or cause the data to get mixed up. The data that was already collected for the fields still display in their correct places on the output page.

  • Let me know if what I’ve explained is confusing.

  • I finally got it to work:

    This is the code I’m using:

    <?php if( get_the_author_meta('street_address_address', $curauth->ID) != '') :?>
    <dt><div class="thelabels"></div>Street Address:  <?php echo $curauth->street_address_address; ?></dt>
    <?php endif;?>
  • Here is the screen shot. It’s taken from the user-edit.php profile editing page.

    screenshot

  • This reply has been marked as private.
  • Hi Elliott,

    I was excited to try the code found on the page you referred to. After trying it out, it still did not work. This is the code I used with my field name substituted in…it’s been inserted under the word “Profile”:

    <?php
     
    $author_id = get_the_author_meta( 'ID' );
    $author_badge = get_field('donor_image1', 'user_'. $author_id ); // image field, return type = "Image Object"
     
    ?>
    <img src="<?php echo $author_badge['url']; ?>" alt="<?php echo $author_badge['alt']; ?>" width="200" height="100" />

    Keep in mind that this isn’t for an actual post page but is for an author page (author.php). The url is http://choochooclan.com/surrogate/author/egglady/ or http://choochooclan.com/surrogate/?author=11 Given that the author ID is 11, I would think that the code would pull that in dynamically and then look for the appropriate image field which is donor_image1 and then display it accordingly. As you can see this is not happening. Is there something else I need to add to the code?

  • I’m trying to do something similar. The user is able to upload their photos from within their profile area of the admin (user-edit.php), and then I add your code (and others I found elsewhere) to author.php, but no pictures ever show up. I’ve substitued your field names with my own to no avail. Any help would be appreciated.

  • @Elliott, Would it be easier for you to solve if I gave you ftp and admin acecess?

  • Would it be easier for you to solve if I gave you ftp and admin acecess?

  • I am saving the fields from within user-edit.php when editing a user profile.

    This is the error I’m getting in the error console:

    TypeError: e is undefined
    http://choochooclan.com/surrogate/wp-content/plugins/advanced-custom-fields/js/input.min.js?ver=4.3.4
    Line 13

  • I first had the format for the image field set at OBJECT, then URL, then ID. None of them worked. It’s currently set to OBJECT.

    You are correct. I’ve connected my field groups to the user profiles and then I display those fields on the author.php template page. All the fields show up correctly for the given user profile EXCEPT for the images (author.php is used to create a profile page).

    Here it is http://choochooclan.com/surrogate/author/Mar/

    If the rest of the fields work for user profiles, why does the image field have a problem?

  • I placed the above code in a template file and it broke the template. The data is coming from a field added to a user’s profile. While editing the profile on user-edit.php, I can see that the data has successfully saved.

    The problem is that the hide/unhide code referenced in my original post doesn’t really pull and unhide the data and its label.

    <?php if( get_field('street_address_address') ): ?>
    	<p>My real address:  <?php the_field('street_address_address'); ?></p>
    	<?php endif; ?>

    The code above shows how I’ve coded my template. If it were to work, it should say:
    My real address: 4027 e. kyle

    But instead nothing shows. Here is the actual page:

    http://choochooclan.com/surrogate/?author=10

    The label and data should show up under the photo/ID #.

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