$post is undefined in wordpress loop [ajax]

Is it okay to call global $post; inside the loop in ajax or is there a better way to access the current post object? I’d do it outside the loop but in the same scope to avoid duplication, but otherwise the answer is: If it works, then it works, don’t stress about it, there is … Read more

Permalink Short code showing unnecessary link text inside the loop

ob_get_flush doesn’t do what you think it does. You’re assuming that it only ends the output buffer and returns its contents, which is incorrect, it also flushes the output buffer to the browser. So this: return ob_get_flush(); Is the same as this: $content = ob_get_clean(); echo $content; return $content; Use ob_get_clean(); instead, which erases the … Read more