Try this:
$posttags = get_the_tags();
$count=0;
if ($posttags) {
foreach($posttags as $tag) {
$count++;
echo '<a href="'.get_tag_link($tag->term_id).'">'.$tag->name.'</a> ';
if( $count >4 ) break;
}
}
Related Posts:
- Add multiple tags to multiple posts
- How to Rearrange WordPress Tags list on frontend using Shortcode with specific order?
- Hide Certain Tags on Single Post Page
- WordPress removing tags?
- Add tag to post api wordpress
- Verify if tag is used on posts
- How to query serialized array by comparing greater than (>=)?
- JSON not valid after json_encode posts
- Include related posts on a page
- How to display post tags
- How to add shortcode tags in single.php [closed]
- What Defines What Category A Post Picks (if in multiple)
- How to update serialized post meta?
- Does an action fire when adding a tag via the “Tags” meta box?
- how to programmatically change post tags
- Filter Posts By Tag
- WordPress post tag & custom field
- WP Query related posts by current page Tag ID
- How to display all posts assigned to some tag?
- How To Add One Tag to Multiple Posts?
- Add Post Tags to Body Class
- How to prevent WordPress from updating the modified time?
- WP Query – duplicated posts once including tags in search results
- wp_tag_cloud() and the_taxonomies() work but not the_tag()
- How to add Tags Filter in wordpress admin dashboard
- Prepend or add an Image to the content of a Post
- Display posts with tag that matches current post title
- How can I make a post that belongs to a category or have specific tags, display different from the other single posts?
- Using permalinks, category slugs, and tag slugs
- “more” tag doesn’t appear when browsing category achives or search
- Insert woocommerce products programmatically with featured image and gallery
- Print all the tags from a custom post type Please
- Display tag image in post using Taxonomy Images plugin index.php
- Help with Taxonomies
- WP_Query: Mixing category__in and tag__in together
- How to add tags (custom taxonomy) to post class css?
- How can I hide tags on a child-category page, if that tag has not been used?
- Custom order for Mysql array
- how to get post order by post id wp_query?
- How to get a post’s content? [closed]
- How Do I Get My Post Tags to Alphabetize?
- WordPress query_posts by tag doesn’t work anymore(?)
- Conditionals if tags exist?
- Displaying posts that belong to a specific author
- Display related post by tag name of current post
- How to remove specific tag from multiple posts?
- Extracting relevant tags associated with that particular single post only
- How to change the layout of posts when viewing all posts by tag [closed]
- See if a post has a specified tag
- How to get post with associated categories and tags names instead of ids with rest api?
- Does WP automatically tag posts into the archive?
- Changing Post Tag Color Based On Post Count
- Removing all post tags except a given list
- How to check if there are posts with the same tag
- How to compare post tags?
- Would a “hub” page work better as a page or a post?
- Add post tags to previously created custom post type
- Plotting posts on a graph
- Short link to read complete post
- Delete all Tag Links from Posts
- How to add tag(s) to all posts from a specific category? [duplicate]
- Categories Listing and Highlighting current category item
- How do I keep raw HTML in my RSS feed and not lose my paragraph breaks?
- Save / Update meta data as multidimensional array
- Can I show category name in url for only one of my categories?
- how to add tags to post in the Loop?
- Merge get_comments & get_posts into a single query
- Is there a way to categorize a list posts all at once?
- How to get tags when using publish_post
- Css and function issue on author archive page
- Tag for custom post type
- WordPress get tags in “publish_post” hook
- Top tags with minimum number of posts
- How to count posts in tags within time limit
- Why do I have categories with duplicate slugs?
- Exclude posts in home slider from sections
- Display all tags even if they are not assigned to a post
- Sync All Post Type Tag
- getting custom post by tag
- Replace Tag Keyword With Link Within Post Content
- Excluding tag Link from html tags in Post content
- show only one category and filter by tag
- Can I Paginate Post after every 25 tag?
- Show all posts from the tags without having to set all of them
- WordPress text field in array problem
- Get the correct meta_value with get_post_meta
- Display only current page -> posts tags in page
- Get current user array with post string
- Add tags to post before it’s created
- Sort Posts Alphabetically by Multiple Categories [duplicate]
- Output posts with same name as tags?
- How can I count articles retrieved by tags
- Should new posts already have tags?
- Display the popular tags by default in the backend post edit page (without having to click on the link that displays them) [closed]
- retrieve post slug by post_tags taxonomy
- Exclude a ‘portfolio’ custom category?
- How to remove a specific script from bulk wordpress posts and images description?
- posts_per_page – Repeats only first posts ‘post__in’ array
- How to create a cumulative posts and members count
- WordPress More tag doesn’t work on Single post