How do you show the posts on a custom post type taxonomy in Controller?

Can someone show me either an article or an explanation on how would you show the contents of a taxonomy at the taxonomy’s page? So my taxonomy is called “section” and I have one “section” called “Car Accident Articles”

So how do i show the contents of that section in here

example.com/section/car-accident-articles
{{show all posts in this section from Controller}}

I am currently doing this in VIEW but it doens’t look anything

  $current = get_queried_object();


$args = array(
    'post_type' => 'knowledge_base',
    'tax_query' => array(
      array(
      'taxonomy' => $current->name,
      'field' => $current->term_id
   )
)
   );
    $the_query = new WP_Query( $args );

Where exactly are you adding that code? I think creating a taxonomy view is what you’re looking for, but it’s not clear what you have already tried.

taxonomy-section.blade.php

If you’re not familiar, this might be helpful: https://developer.wordpress.org/themes/template-files-section/taxonomy-templates/

This topic was automatically closed after 42 days. New replies are no longer allowed.