0 down vote favorite
I have problem when install the plugin Google authorship for multiple authors in here: https://www.ads-software.com/extend/plugins/google-authorship-for-multiple-writers/ After install and config to run it OK. I just see that, the plugin always show the content in the loop.php, not display the content in the single.php.
I looking for the plugin and see this code:
add_action(‘the_content’, ‘google_authorship_content’, 5);
As i understand it always call the method the_content(). So, it always get the content from the loop.php? But i would like it get the content from the single.php. Anybody had problem and fixed it?
https://www.ads-software.com/plugins/google-authorship-for-multiple-writers/
]]>Plugin: https://www.ads-software.com/plugin/google-authorship-for-multiple-writers
To fix replace following code:
add_action('single_template', 'google_authorship_single');
function google_authorship_single() {
global $google_authorship_single;
$google_authorship_single = true;
}
with:
add_filter( 'single_template', 'google_authorship_single', 10, 1 );
function google_authorship_single( $template ) {
global $google_authorship_single;
$google_authorship_single = true;
return $template;
}
But the best would be to replace usage of global $google_authorship_single
with conditional tag is_singular()
in functions that needs this information.
Why?! ‘single_template’ is a filter hook and not an action hook – so, it must return value
https://www.ads-software.com/plugins/google-authorship-for-multiple-writers/
]]>It brokes the site, changing my post page (single) to a part of my website home page.
https://www.ads-software.com/extend/plugins/google-authorship-for-multiple-writers/
]]>Someone after installing the plugin, it’s not longer possible to open the articles itself.
https://www.ads-software.com/extend/plugins/google-authorship-for-multiple-writers/
]]>