The code below displays posts that have matching 'page name' and 'category slug'.. but I am trying to get it to use a custom taxonomy. How do I incorporate that into the below? I'm using this in my function file:
function my_get_posts( $category_name )
{
// set the criteria
$args = array(
'numberposts' => -1,
'category_name' => $category_name,
'post_type' => 'custom_type'
);
// return the object array of the posts.
return get_posts( $args );
}
and this in my page
<?php
$posts_returned = my_get_posts($post->post_name);
foreach ($posts_returned as $post_returned) {
$postlink = get_post_permalink($post_returned->ID);
?>
HTML HERE
<?php } ?>