First you need to get the ID of the page/post/content you’re viewing. Then, you can call get_the_terms()
and pass it that ID so it knows you want the tags for that specific piece of content.
<?php
$mtags = get_the_terms( get_queried_object_id(), 'custom_tag' );
?>
There isn’t an orderby
parameter, so you may need to sort the array afterward if you want them in a specific order.
Related Posts:
- Why is wp_kses not keeping style attributes as expected?
- WordPress: Can I add categories/tags to all sites in my network at once?
- How to Get Next or Previous Post in a Specific Tag?
- Stop wordpress from removing HTML attributes
- What is the difference between terms and tags?
- How can you tie into the tag metabox?
- How to use the Tag description as the title attribute?
- Apply class to the a tag link generated in post tag links
- Showing all tags in admin -> edit post
- Redirect Tag to Post with the same name
- Add exception for specific tag
- Link from tags to tag pages displaying all posts with that tag
- How can I extend Quick Edit option with 2 more fields
- How to separate the tags?
- Creating a unique, linked list of tags from a specific category?
- Add # before each tag
- term/tag not being saved for custom post type
- require one tag for each post
- How can I remove certain HTML tags from the RSS feed?
- WP API Get post with tag names instead of tag ID’s
- get_terms with more than x post count
- Why ‘C++’ tag is converted to ‘C# ‘?
- How to show tags in posts, orderby count(most used) not alphabetically?
- Display all posts of current viewing tag
- Exclude specific tags (by id) from the_tags
- Is is possible to rebuild wp_term_relationships table?
- Sort list of WordPress Page under tag when is_tag() called
- How to not show tags if the post doesn’t have any?
- Get the tags as an array, convert the tag into a string, and then replace spaces with dash
- Tag with Alias capability
- Setting a value on existing tag metadata field when that tag was just created by a user
- How to remove tag base from permalinks
- Creating a “Tags” page with search option, instead of using a widget
- Remove the last character from tag name in tag archive page
- Use current date as tag?
- how to filter each tag item?
- Creating custom tags
- What is the best way to create a menu item that links to all posts with a certain tag?
- mystery tags which I didn’t add – vulnerability?
- How can I make an auto-fill search box auto-completing with the tags?
- using get_the_category to get all post categories except one
- How to hide certain tags from the_tags()?
- OG Meta Tags not being scraped by facebook or twitter
- List tags by certain letter issue with special chars like å, ä and ö
- Adding post tags without capability edit_posts
- Get Adjacent Post By Tag
- Track tags in Google Analytics? [closed]
- Remove short link tag from particular page
- tags not showing on custom post type single page
- Stop wordpress from adding html tags but not remove my own tags?
- merging terms programmatically while maintaining the count
- How to get the first tag of a post as a hyperlink?
- Echo tag name if post has one of the tags
- Display post if a specific tag is present
- Why is Heading tag Auto applied to Post data? [closed]
- Do we have In_category like function for tags?
- Tagcloud: different color for different text size
- Can’t Find a “Most Popular Tags” Hack Anywhere [closed]
- “ Language notation in the post content
- how do i put “h1” tag in css as class and call it anywhere in the website files [closed]
- Sort tags by first letter or included number
- WordPress tags as twitter sharer URL hastags
- Add post tag without post id
- Removing a taxonomy term
- Show all videos by tag name
- Changing H1 to Normal Links
- How to change tag Title to its name?
- Setup proper 301 redirect for deleted tags
- Problem using the word “RSS” as a tag
- Bumping a (tagged) post to the top of archives
- Print_r displaying two different post->ID if placed in sidebar or single.php
- How to set thumbnail for each tag?
- Missing tags, unexisting tags in search form within products, please help
- Tags page not for post
- Automatically add tag (first 4 characters) to uploaded media
- Remove link and Add class to get_the_tag_list()
- How to get tags from different blog?
- Get the publish date of the older post inside a tag
- How to test if the tag list is empty for the current page?
- Unwanted word behind my title in SERP
- Unable to Change Title in WordPress Dashboard
- How to Group While Loop “Results” of wp_query?
- get_the_tags function not retrieve all tags for specific category
- Auto-Tagging a Custom Post Type
- Hide Tag Title When No Tags
- Feedburner closing error
- Change CSS on tag in tagcloud, if ther current post is tagged with the tag
- Display posts containing at least 1 from a list of say 10 tags but not containing other tags
- where to find on backend to amend and edit title tage for each page on website?
- Create a separate widget for both Tags and TagsCloud?
- How to make a Post Tag primary?
- How can I edit the slugs of tags?
- Tags as autocomplete values
- Need to return all tags – including empty ones – in list
- Listing tags with custom html output
- Exclude specific tag or tags from related posts?
- Show tags in post? Function not working
- How to export tag counts to excel?
- How to make attachment tag archive visible on page
- What file is responsible with tags displaying on the post?