/ Published in: PHP
For example, when you can't get the post author to shop up using the_author(); it usually means your working outside the loop while that function is meant to work inside the loop.
This is a way around it. (got it from the forums)
This is a way around it. (got it from the forums)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
src: http://wordpress.org/support/topic/the_author-not-displaying-anything-ideas When not using the loop, you need to manually prepare the data with setup_postdata($post), as such: ' $query = get_posts('showposts=5'); foreach($query as $post) { setup_postdata($post); //loads all data, including meta for access //resume adding template tags as normal } '
URL: http://wordpress.org/support/topic/the_author-not-displaying-anything-ideas