{"action":"created","issue":{"url":"https://api.github.com/repos/alfdc/wp-frontend-avatar-upload/issues/3","repository_url":"https://api.github.com/repos/alfdc/wp-frontend-avatar-upload","labels_url":"https://api.github.com/repos/alfdc/wp-frontend-avatar-upload/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/alfdc/wp-frontend-avatar-upload/issues/3/comments","events_url":"https://api.github.com/repos/alfdc/wp-frontend-avatar-upload/issues/3/events","html_url":"https://github.com/alfdc/wp-frontend-avatar-upload/issues/3","id":192920471,"number":3,"title":"How to display uploaded avatar site wide on .php template?","user":{"login":"monecchi","id":5252519,"avatar_url":"https://avatars.githubusercontent.com/u/5252519?v=3","gravatar_id":"","url":"https://api.github.com/users/monecchi","html_url":"https://github.com/monecchi","followers_url":"https://api.github.com/users/monecchi/followers","following_url":"https://api.github.com/users/monecchi/following{/other_user}","gists_url":"https://api.github.com/users/monecchi/gists{/gist_id}","starred_url":"https://api.github.com/users/monecchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monecchi/subscriptions","organizations_url":"https://api.github.com/users/monecchi/orgs","repos_url":"https://api.github.com/users/monecchi/repos","events_url":"https://api.github.com/users/monecchi/events{/privacy}","received_events_url":"https://api.github.com/users/monecchi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-01T18:07:32Z","updated_at":"2016-12-01T18:23:37Z","closed_at":null,"body":"Really nice plugin! I'm giving it a try right now. \r\n\r\nOk, now about the issue with displaying the uploaded avatar site wide, here's what I've been trying to accomplish:\r\n \r\nUnder WooCommerce my account template I've placed the following php code so the user can upload his avatar:\r\n\r\n`<?php echo do_shortcode('[frontend_avatar_upload]'); ?>`\r\n\r\nAfter uploading the avatar image, it is promptly displayed right where the shortcode is placed. So far, so good.\r\n\r\nBUT\r\n\r\nWhat about other sections of the site which displays the user avatar? I was hoping the plugin to have a unique shortcode just for displaying the uploaded avatar across the entire site.\r\n\r\nIn my **header.php** template, I'm trying to use part of the plugin's code to display the uploaded avatar, but it only returns the default avatar image instead:\r\n\r\n    <?php if($profile_avatar == ''){?>\r\n\r\n    <?php echo get_avatar(get_current_user_id(),100,'','',array('class'=>''))?>\r\n\r\n    <?php }else{?>\r\n\r\n    <img class=\"avatar avatar-100 photo img-responsive img-circle\" width=\"100\" height=\"100\" src=\"    <?php echo $profile_avatar;  ?>\" alt=\"\">\r\n\r\n    <?php } ?> \r\n\r\nHow can I display the uploaded avatar on my website's php header template? As the image bellow shows, the above conditional code does not displays the avatar.\r\n\r\n![captura de tela 2016-12-01 as 15 50 38](https://cloud.githubusercontent.com/assets/5252519/20805924/eb533926-b7df-11e6-9e0f-8ac8e4270df7.png)\r\n"},"comment":{"url":"https://api.github.com/repos/alfdc/wp-frontend-avatar-upload/issues/comments/264251744","html_url":"https://github.com/alfdc/wp-frontend-avatar-upload/issues/3#issuecomment-264251744","issue_url":"https://api.github.com/repos/alfdc/wp-frontend-avatar-upload/issues/3","id":264251744,"user":{"login":"monecchi","id":5252519,"avatar_url":"https://avatars.githubusercontent.com/u/5252519?v=3","gravatar_id":"","url":"https://api.github.com/users/monecchi","html_url":"https://github.com/monecchi","followers_url":"https://api.github.com/users/monecchi/followers","following_url":"https://api.github.com/users/monecchi/following{/other_user}","gists_url":"https://api.github.com/users/monecchi/gists{/gist_id}","starred_url":"https://api.github.com/users/monecchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monecchi/subscriptions","organizations_url":"https://api.github.com/users/monecchi/orgs","repos_url":"https://api.github.com/users/monecchi/repos","events_url":"https://api.github.com/users/monecchi/events{/privacy}","received_events_url":"https://api.github.com/users/monecchi/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T18:23:37Z","updated_at":"2016-12-01T18:23:37Z","body":"I've managed to solve it by getting the right meta with:\r\n\r\n`$current_user_id = wp_get_current_user()->ID;`\r\n`$profile_avatar = get_user_meta($current_user_id,'_fau_url',true);`\r\n\r\nNow the uploaded avatar is displayed right where the conditional php code above is placed."}}
{"actor":{"display_login":"monecchi"}}