Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix for people using "the_content" in odd places

  • Loading branch information...
commit f760e395edd8bda88e8d784621bb8a04cc3e8c0c 1 parent 0732110
@matzko authored
Showing with 10 additions and 9 deletions.
  1. +1 −1  readme.txt
  2. +9 −8 seo-for-paged-comments.php
View
2  readme.txt
@@ -4,7 +4,7 @@ Donate link: http://pressedwords.com/solving-wordpress-seo-paged-comments-proble
Tags: comments, seo, paged-comments, paged
Requires at least: 2.7
Tested up to: 2.8
-Stable tag: 1.0
+Stable tag: 1.1
Reduce SEO problems when using WordPress's paged comments.
View
17 seo-for-paged-comments.php
@@ -1,20 +1,21 @@
<?php
-/*
+/*
Plugin Name: SEO for Paged Comments
- Version: 1.0
+ Version: 1.1
Description: Reduce SEO problems when using WordPress's paged comments.
- Plugin URI: http://pressedwords.com/solving-wordpress-seo-paged-comments-problem/
Author: Austin Matzko
Author URI: http://www.pressedwords.com
*/
function seo_paged_comments_content_filter($t = '') {
- $cpage = intval(get_query_var('cpage'));
- if ( ! empty( $cpage ) ) {
- remove_filter('the_content', 'seo_paged_comments_content_filter');
- $t = get_the_excerpt();
- $t .= sprintf('<p><a href="%1$s">%2$s</a></p>', get_permalink(), get_the_title());
+ if ( function_exists('get_query_var') ) {
+ $cpage = intval(get_query_var('cpage'));
+ if ( ! empty( $cpage ) ) {
+ remove_filter('the_content', 'seo_paged_comments_content_filter');
+ $t = get_the_excerpt();
+ $t .= sprintf('<p><a href="%1$s">%2$s</a></p>', get_permalink(), get_the_title());
+ }
}
return $t;
}
Please sign in to comment.
Something went wrong with that request. Please try again.