extensions/blocks/homepage-articles/class-newspack-blocks-api.php 1 location
|
@@ 262-268 (lines=7) @@
|
| 259 |
|
$category = false; |
| 260 |
|
|
| 261 |
|
// Use Yoast primary category if set. |
| 262 |
|
if ( class_exists( 'WPSEO_Primary_Term' ) ) { |
| 263 |
|
$primary_term = new WPSEO_Primary_Term( 'category', $object['id'] ); |
| 264 |
|
$category_id = $primary_term->get_primary_term(); |
| 265 |
|
if ( $category_id ) { |
| 266 |
|
$category = get_term( $category_id ); |
| 267 |
|
} |
| 268 |
|
} |
| 269 |
|
|
| 270 |
|
if ( ! $category ) { |
| 271 |
|
$categories_list = get_the_category( $object['id'] ); |
extensions/blocks/homepage-articles/templates/article.php 1 location
|
@@ 38-44 (lines=7) @@
|
| 35 |
|
} |
| 36 |
|
$category = false; |
| 37 |
|
// Use Yoast primary category if set. |
| 38 |
|
if ( class_exists( 'WPSEO_Primary_Term' ) ) { |
| 39 |
|
$primary_term = new WPSEO_Primary_Term( 'category', get_the_ID() ); |
| 40 |
|
$category_id = $primary_term->get_primary_term(); |
| 41 |
|
if ( $category_id ) { |
| 42 |
|
$category = get_term( $category_id ); |
| 43 |
|
} |
| 44 |
|
} |
| 45 |
|
if ( ! $category ) { |
| 46 |
|
$categories_list = get_the_category(); |
| 47 |
|
if ( ! empty( $categories_list ) ) { |