Displaying the most recently used tags

Sure, just feed your tag list to wp_generate_tag_cloud: $found_tags = $final_tags = $id_records = array(); // get last 10 posts $last_posts = get_posts(‘numberposts=10’); // gather tags foreach($last_posts as $post) $found_tags = array_merge($found_tags, wp_get_post_tags($post->ID)); // prepare final tags for the cloud foreach($found_tags as $tag){ // ignore duplicates if(in_array($tag->term_id, $id_records)) continue; // track ids… $id_records[] = $tag->term_id; … Read more

Link from tags to tag pages displaying all posts with that tag

you haven’t shown in your code how you get $tag, therefore I include my version (the code has to be in the loop): <?php $tags = get_the_tags(); if( $tags ) foreach( $tags as $tag ) { ?> <a href=”https://wordpress.stackexchange.com/questions/30250/<?php echo get_tag_link($tag->term_id); ?>”><?php echo $tag->name; ?></a> <?php break; } ?> http://codex.wordpress.org/Function_Reference/get_the_tags

Creating a Lightweight Media Tags Plugin with a Custom Taxonomy

Sadly, I haven’t found the flaw in your code as far as update counts. Copy and paste mine for comparison (stick it in a plugin you can easily deactivate). This works like a charm, with all counts updating correctly: class ZGAttachmentTags { const SLUG = ‘attachment-tags’; function __construct() { add_action( ‘init’, array( $this, ‘register_custom_taxonomy’ ) … Read more

Add exception for specific tag

The get_the_tags() function returns an array of objects. So, you can step through the this array, and unset the object for the “Featured” tag, perhaps like so: <?php $tags = get_the_tags(); foreach ( $tags as $tag_key => $tag_object ) { if ( ‘featured’ == $tag_object->slug ) { unset( $tags[$tag_key] ); } } // Continue with … Read more

Redirect Tag to Post with the same name

Try the code from this article: http://metinsaylan.com/wordpress/2011/02/15/how-to-redirect-to-single-post-page-if-there-is-one-post-in-categorytag/ It checks $wp_query->post_count and redirects to the only article of an archive if there is just one.

Allow visitors to search by multiple tags (specific IDs)

Solution 1) First, make sure you are using WordPress 4.3, which was just released, or this won’t work. 2) Second, drop the entire pre_get_posts hook, you won’t need it. WordPress will automatically filter the search archive based on the terms you’ve included in the querystring (this is the 4.3 functionality I just mentioned). 3) Next, … Read more

Display tags belonging to a specific post type only

I’ve been successfully using the following code from @StephenHarris from this answer. I have made a small tweak or two to the original code, but the most significant is to name the new count object to count_type from the original COUNT* that was returned by default Just in short again, the function works exactly like … Read more

Combining tags from post types

As John said in his comment, you have two taxonomies with separate terms. If both posts and portfolios are to share tags, instead of using a new taxonomy just extend post_tags to portfolio custom post type : register_taxonomy_for_object_type( ‘post_tag’, ‘portfolio’ );