diff --git a/modules/metadescription/views/metadescription_block.html.php b/modules/metadescription/views/metadescription_block.html.php index 5083c55b..bfeacf2a 100644 --- a/modules/metadescription/views/metadescription_block.html.php +++ b/modules/metadescription/views/metadescription_block.html.php @@ -23,10 +23,17 @@ if ($metaDescription == "") { $metaDescription = p::clean($item->title); } + // If this page belongs to a tag, use the description of the first item instead. + if ($theme->tag()) { + if (count($children) > 0) { + $metaDescription = trim(nl2br(p::purify($children[0]->description))); + } + } // If it's still empty, use $metaTags. if ($metaDescription == "") { $metaDescription = $metaTags; } + // Strip HTML $metaDescription = strip_tags($metaDescription); // Strip Line Breaks