Commit 385be757 authored by Bruno Antunes Magrini's avatar Bruno Antunes Magrini

Add singular verification

parent 4b02c6fb
......@@ -18,7 +18,16 @@ class SeeAlsoPostsList extends PostsList {
);
}
function get_template_variables($instance, $args) {
if (!is_singular()){
return [
'query' => (object) array(),
'link' => (object) array(),
'show_excerpt' => '',
'hide_categories' => '',
'css_classes' => '',
'show_images' => ''
];
}
$post_id = get_queried_object()->ID;
$term_list = wp_get_post_terms($post_id, 'category', array( 'fields' => 'ids' ) );
$posts_query_args = array(
......
<?php
use guaraci\images;
$i = 0;
if(is_singular()):
?>
<div class="posts-list <?= $css_classes ?>">
<div class="row">
......@@ -57,3 +57,4 @@ $i = 0;
</div>
<?php endif; ?>
</div>
<?php endif;
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment