For the same post, I have suddenly a weird behaviour of
single.php file between normal user and administrator.
In the beginning of the loop, I perform:
echo '<pre dir="ltr">'; print_r($GLOBALS['wp_query']); echo '</pre>';
And the result is different.
In the case of administrator:
[queried_object_id] => 603 [request] => SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'test' AND wp_posts.post_type = 'aya-bi-aya' ORDER BY wp_posts.post_date DESC
In the case of non-administrator:
[queried_object_id] => 0 [request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'aya-bi-aya' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10
I spent one day and a half trying to figure out what can be the reason behind this dysfunctionning, but in vain. Your time is really invaluable.