Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

GPlus Authorship: Add check for main loop.

`is_main_query()` will return true, even if outside the loop when the global `$wp_query` variable is not replaced with a different query. `in_the_loop()` will check if we're in the main loop, and set the function's return value to `false`, if we're not.
  • Loading branch information...
commit 82dae8fecbc45b13e393f31a5ff39e1ffc87a8de 1 parent 8bb936f
@obenland obenland authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  modules/gplus-authorship.php
View
2  modules/gplus-authorship.php
@@ -33,7 +33,7 @@ function __construct() {
function show_on_this_post() {
global $post;
$show = apply_filters( 'gplus_authorship_show', true, $post );
- if ( !is_main_query() )
+ if ( ! is_main_query() || ! in_the_loop() )
$show = false;
$author = $this->information( $post->post_author );
if ( empty( $author ) )
Please sign in to comment.
Something went wrong with that request. Please try again.