term_id; $args = array( 'numberposts' => -1, 'post_status' => 'publish', 'post_type' => 'richtlijnen', 'order' => 'ASC', 'orderby' => 'title', 'tax_query' => array( array( 'taxonomy' => 'categorien', 'field' => 'id', 'terms' => $term->term_id ) ) ); $richtlijnen = get_posts($args); /*print"
";
		print_r($richtlijnen);
		exit;
		*/
		//Inititiefnemer koppelen en checken
		//Externe links
		//Datum
		//
		$cat_title = '';
		$cat_inhoud = '';
			
		if ( $richtlijnen ) {
			$term_meta = get_term_meta($term->term_id);
			$cat_title = "

".$term->name."

"; foreach ( $richtlijnen as $richtlijn ) : $meta = get_post_meta($richtlijn->ID,'',true); $initiatiefnemer = $meta['initiatiefnemer']['0']; //print $richtlijn->ID; //print $initiatiefnemer."
"; if (str_contains($initiatiefnemer, $website)){ if ($zoekterm){ if (str_contains(strtolower($richtlijn->post_title), strtolower($zoekterm))){ $post_url = get_permalink($richtlijn->ID); $link = $meta['link']['0']; $jsurl = "location.href='".$post_url."'"; if ($link){ $jsurl = "window.open('".$link."', '_blank')"; } /*print "
";
							print_r($richtlijn);
							print_r($meta);*/
							$datum = $meta['autorisatiedatum']['0'];
							$cat_inhoud .='
							
'.$richtlijn->post_title.'
'.$datum.'
'; } }else{ $post_url = get_permalink($richtlijn->ID); $link = $meta['link']['0']; $jsurl = "location.href='".$post_url."'"; if ($link){ $jsurl = "window.open('".$link."', '_blank')"; } /*print "
";
							print_r($richtlijn);
							print_r($meta);*/
							$datum = $meta['autorisatiedatum']['0'];
							$cat_inhoud .='
							
'.$richtlijn->post_title.'
'.$datum.'
'; } } endforeach; if ($cat_inhoud){ print $cat_title; print $cat_inhoud; } wp_reset_postdata(); } endforeach; ?>