在我的主页上,我写了一个查询来显示分类法中的所有元素(jobpost_job_type) 我想将它们链接到存档页面,但是要调整搜索的网址,以便显示正确的结果。
$args = array(
'hide_empty' => false
);
$taxonomy = 'jobpost_job_type';
$terms = get_terms($taxonomy,$args);
$terms_count = $terms->count;
?>
<div class="jobs__types--wrapper">
<?php if ( $terms && !is_wp_error( $terms ) ) { ?>
<?php foreach ( $terms as $term ) { ?>
<a class="jobs__types--item" href="<?php echo get_term_link($term->slug,$taxonomy); ?>"><?php echo $term->name; echo get_term_link($term->slug,$taxonomy); ?><span> (<?php echo $term->count; ?>)</span></a>
<?php } ?>
<?php } ?>
<a class="jobs__types--item" href="">Spontaan solliciteren</a>
<a class="jobs__types--item" href="">Werken bij ons</a>
<a class="jobs__types--item" href="">Andere</a>
</div>
现在链接指向的网址是:https://ago.staging.dfib.net/vacatures-type/maintenance-engineering/ 我想将其更改为:https://ago.staging.dfib.net/vacatures/?search_keywords=&selected_jobtype=maintenance-engineering&selected_location=-1
如何仅从子弹中获取“维护工程师”并在所需的URL中使用?