{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/_s/issues/958","repository_url":"https://api.github.com/repos/Automattic/_s","labels_url":"https://api.github.com/repos/Automattic/_s/issues/958/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/_s/issues/958/comments","events_url":"https://api.github.com/repos/Automattic/_s/issues/958/events","html_url":"https://github.com/Automattic/_s/issues/958","id":155784256,"number":958,"title":"using the function _s_posted_on() outside the loop","user":{"login":"saltnpixels","id":11615474,"avatar_url":"https://avatars.githubusercontent.com/u/11615474?v=3","gravatar_id":"","url":"https://api.github.com/users/saltnpixels","html_url":"https://github.com/saltnpixels","followers_url":"https://api.github.com/users/saltnpixels/followers","following_url":"https://api.github.com/users/saltnpixels/following{/other_user}","gists_url":"https://api.github.com/users/saltnpixels/gists{/gist_id}","starred_url":"https://api.github.com/users/saltnpixels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saltnpixels/subscriptions","organizations_url":"https://api.github.com/users/saltnpixels/orgs","repos_url":"https://api.github.com/users/saltnpixels/repos","events_url":"https://api.github.com/users/saltnpixels/events{/privacy}","received_events_url":"https://api.github.com/users/saltnpixels/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-19T16:49:56Z","updated_at":"2016-05-19T17:02:22Z","closed_at":"2016-05-19T17:02:22Z","body":"Based on another issue I had before of outputting article info outside the loop, I was trying to output the meta outside the loop too.\r\nI wanted to use the function that comes with underscores _s_posted_on();\r\nFor the most part this works fine. \r\nAll the template tags in there default to the current post like getting the date and stuff.\r\n\r\nThe only problem is the author does not show up because it needs to be in the loop.\r\nI fixed it, but I am not sure this counts as an issue or just my project... :)\r\n\r\nI'm new around here....\r\nAnyways you can replace it with this, and now you can use the funciton in or outside the loop.\r\n```\r\nglobal $post;\r\n$author_id = $post->post_author;\r\n\r\n$byline = sprintf(\r\n   esc_html_x( 'by %s', 'post author', 'seasaltpress' ),  \r\n  '<span class=\"author vcard\"><a class=\"url fn n\" href=\"' . esc_url( get_author_posts_url( get_the_author_meta( 'ID', $author_id ) ) ) . '\">' . esc_html( get_the_author_meta( 'nickname', $author_id ) ) . '</a></span>'\r\n\t);\r\n```"},"comment":{"url":"https://api.github.com/repos/Automattic/_s/issues/comments/220388289","html_url":"https://github.com/Automattic/_s/issues/958#issuecomment-220388289","issue_url":"https://api.github.com/repos/Automattic/_s/issues/958","id":220388289,"user":{"login":"davidakennedy","id":1473618,"avatar_url":"https://avatars.githubusercontent.com/u/1473618?v=3","gravatar_id":"","url":"https://api.github.com/users/davidakennedy","html_url":"https://github.com/davidakennedy","followers_url":"https://api.github.com/users/davidakennedy/followers","following_url":"https://api.github.com/users/davidakennedy/following{/other_user}","gists_url":"https://api.github.com/users/davidakennedy/gists{/gist_id}","starred_url":"https://api.github.com/users/davidakennedy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidakennedy/subscriptions","organizations_url":"https://api.github.com/users/davidakennedy/orgs","repos_url":"https://api.github.com/users/davidakennedy/repos","events_url":"https://api.github.com/users/davidakennedy/events{/privacy}","received_events_url":"https://api.github.com/users/davidakennedy/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T17:02:22Z","updated_at":"2016-05-19T17:02:22Z","body":"Hey @saltnpixels!\r\n\r\nWelcome! Thanks for filing this issue. That's a good way to modify the function if you need it outside of the loop, and perfectly valid. But I don't think the function in _s needs to be changed because most wouldn't need to use it that way, and if themers need to, they can make the modification as you have.\r\n\r\nCheers!"}}