Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solution: News Manager & External Commenting Working Together
#2
Another issue when configuring NewsManager to turn GS into a blog is that the excerpts on the news page (i.e. whatever is configured to be the front page) ignore formatting tags, resulting in a wall-of-text for longer excerpts. To address this, open the NewsManager file /inc/functions.php and remove this line from the nm_create_slug function:

Code:
$content = strip_tags($content);

Before:
Code:
/*******************************************************
* @function nm_create_excerpt
* @param $content the post content
* @return a truncated version of the post content
*/
function nm_create_excerpt($content) {
  global $NMEXCERPTLENGTH;
  $len = intval($NMEXCERPTLENGTH);
  $content = strip_tags($content);
  if (strlen($content) > $len) {
    if (function_exists('mb_substr'))
      $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . ' [...]';
    else
      $content = trim(substr($content, 0, $len)) . ' [...]';
  }
  return "<p>$content</p>";
}

After:
Code:
/*******************************************************
* @function nm_create_excerpt
* @param $content the post content
* @return a truncated version of the post content
*/
function nm_create_excerpt($content) {
  global $NMEXCERPTLENGTH;
  $len = intval($NMEXCERPTLENGTH);
   if (strlen($content) > $len) {
    if (function_exists('mb_substr'))
      $content = trim(mb_substr($content, 0, $len, 'UTF-8')) . ' [...]';
    else
      $content = trim(substr($content, 0, $len)) . ' [...]';
  }
  return "<p>$content</p>";
}
Reply


Messages In This Thread
Solution: News Manager & External Commenting Working Together - by jsmcgraw - 2012-02-20, 06:36:42



Users browsing this thread: 1 Guest(s)