Archive Pages, JSON+LD, Description
-
I found a bug in plugins\schema-and-structured-data-for-wp\output\output.php, line 4078. You use $cat variable, but need to use $cat_term. In this case $cat_description will be always ” for archive pages.
$cat_description = '';
if ( $category_id > 0 ) {
$cat_term = get_term( $category_id );
if ( is_object( $cat_term ) && ! empty( $cat_term ) ) {
$cat_description = isset( $cat->description ) ? wp_strip_all_tags( $cat->description ) : '';
}
}the correct code
$cat_description = '';
if ( $category_id > 0 ) {
$cat_term = get_term( $category_id );
if ( is_object( $cat_term ) && ! empty( $cat_term ) ) {
$cat_description = isset( $cat_term->description ) ? wp_strip_all_tags( $cat_term->description ) : '';
}
}
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
You must be logged in to reply to this topic.