I am using custom taxonomies.
How to check if current page has tag_ID = "XXX"
?
If that is any help the URL form WordPress admin looks like this:
http://localhost/website/wp-admin/edit-tags.php?action=edit&taxonomy=company&tag_ID=13&post_type=news
Update. Here is code which I’m currently using. Does not work.
<?php
function insert_news($company = 0)
{
global $post;
$count = 0;
$news_query = new WP_Query(array(
'post_type' => 'news',
'posts_per_page' => -1,
'orderby' => 'date',
'order' => 'ASC',
'company' => $company
));
$total_count = $news_query->post_count;
while ($news_query->have_posts()):
$news_query->the_post();
$count++;
$tag_id = get_query_var('tag_id');
if ($tag_id && $tag_id == '14') {
// ID 14
} else if ($tag_id && $tag_id == '13') {
// ID 13
} else if ($tag_id && $tag_id == '12') {
// ID 12
}
endwhile;
}
?>