@jb,
I can’t be 100% sure but I suspect it’s a plugin issue and here’s why:
The confirmation message (title and content) is applied by using the WordPress filter API, the title hooks into ‘the_title’ and the content hooks into ‘the_content’.
Now, both of these hooks should only be called from in ‘the_loop’, which means when WordPress is cycling through your posts trying to find which to display on the browser screen. Subscribe2 only filters once to prevent unexpected results.
Now, it seems that on your site, perhaps a plugin is running to gather some information via ‘the_content’ hook and push that into your meta description tag.
I’d argue that calling ‘the_content’ there is calling it too early and is a bad idea from WordPress coding standards.
I hope some of that makes sense. The easy way to check is to disable all of your other plugins and try again. If the message displays correctly, reactivate your plugins one at a time to find the plugin that calls ‘the_content’ too early.
Thread Starter
jbd7
(@jbd7)
Hi Matt,
Thanks for your quick reply. I deactivated all other plugins and it still didn’t behave at it should.
I am using Arras theme. Are you aware of problems with it?
jb
@jb,
Fortunately Arras is open source, and you are right, it is the cause of the problem.
Have a look in the arras theme folder in the library/template.php file. In there you’ll find this function:
function arras_document_description() {
if ( class_exists('All_in_One_SEO_Pack') || class_exists('Platinum_SEO_Pack') ) return false;
if ( is_single() || is_page() ) {
if ( have_posts() ) {
while( have_posts() ) {
the_post();
echo '<meta name="description" content="' . get_the_excerpt() . '" />';
}
}
} else {
echo '<meta name="description" content="' . get_bloginfo('description') . '" />';
}
}
At the end of that function I think you need to add wp_reset_query();
so the loop is reset. That should fix it.
@jb,
I’ve logged this as an issue on the Arras Theme github site also:
https://github.com/zyml/arras-theme/issues/75
Thread Starter
jbd7
(@jbd7)
Thanks! That’s exactly that.
Except that adding wp_reset_query();
before the function end didn’t have any effect. On the other hand, I have the SEO plugin by Yoast which is not considered by Arras, so I could exit the function at the beginning.
@jb,
Exiting that function earlier and bypassing the code altogether should work also. It will mean that you done get the content generated by that function but perhaps that’s okay.