Plugin Author
remix4
(@remix4)
Hi,
Try checking on the WordPress Codex:
http://codex.ww.wp.xz.cn/
Plugin Author
remix4
(@remix4)
Hi,
Try checking on the WordPress Codex:
http://codex.ww.wp.xz.cn/
I have read all documentation related to the “out of the loop” thing. I googled almost everything I couldn’t think of and tried different approaches:
1.
$author_id=$post->post_author;
2.
global $post;
$author_id=$post->post_author;
3.
$post_tmp = get_post($post_id);
$author_id = $post_tmp->post_author;
4.
$author_id = $posts[0]->post_author;
But none is working. So, I thought that the plugin may have some custom coding/function altering this :-/
Thanks
Did you try these for debugging:
global $post;
print_r( $post );
to see what the $post contains (maybe you need to use a different field instead of $post->post_author to get the ID), and
echo $post_id;
to see if $post_id is set (get_post() doesn’t work without a proper ID argument).
The key for finding the solution you’re looking for is to get a visual of what data you have or don’t have in order to see what exactly is missing.