My PHP shortcode only displays 4 related blog posts on the page, but there are many more related. This is my shortcode:
function bloglink(){
global $taxonomy;
$queried_object = get_queried_object();
$term_id = $queried_object->term_id;
$args = [
'orderby' => 'ASC',
'post_type' => 'blog',
'tax_query' => [['taxonomy' => 'people',
'field' => 'term_id',
'terms' => $term_id,]]
];
$loop = new WP_Query( $args );
if ($loop->have_posts()) :
$count = $loop->found_posts;
$out .= '<a class="awithbackground" href="#taxonomycontent4"> Blogs ('.$count.')</a>';
endif;
return $out;
}
add_shortcode ('bloglink', 'bloglink');
I need some suggestons, thanks!