I'm working both locally and remotely, pushing code via git. I have the current code set up below, which looks for tags and outputs them as a list using wp_list_categories
. I need to use the include
parameter as there is no hierarchy with tags (I can't use categories in this instance).
However, as I am working locally and remotely, there's a chance that the IDs from local to remote won't be the same. So, ideally, I'd like to include by name
or slug
, but I know the include
parameter only allows IDs.
Is there any way to include either name
or slug
in the include
parameter?
Idea: My friend said we could have a list of names, and loop through them all and use get_term_by to get the id – but I'm not exactly sure where to start...
Thanks in advance, R
<?php $sector_args = array(
'taxonomy' => 'post_tag',
'show_count' => 0,
'pad_counts' => 0,
'title_li' => '',
'include' => '5,6,7'
); ?>
<ul>
<?php wp_list_categories( $sector_args ); ?>
</ul>