How to separate the tags?

You need to use another function to get the tags, something that returns an object or an array, like that you can manipulate it as you need. http://codex.wordpress.org/Function_Reference/get_tags <?php $my_tags = get_the_tags();?> Then where you need the first tag: <?php echo $my_tags[0]->name?> For looping the rest except the first tag: <?php $count=1; foreach ($my_tags as … Read more

Can’t Get ‘tag’ Page To Display only Tagged Posts

The problem is this line: query_posts( ‘posts_per_page=5′ ); You’re overwriting the query for this page with a query for the 5 latest posts, regardless of tag, category, etc.. If you remove that line, your template will work as expected. If you want to limit tag pages to only 5 posts, use a pre_get_posts action: function … Read more

How can I extend Quick Edit option with 2 more fields

A small example from my last project. The important part is the hook quick_edit_custom_box. On this hook can you add your form elements. The second important part is to add your script that update the data via javascript. The script in this example was add to the head in edit.php; it is better on footer … Read more

When are tags counted? Can it be trigered manually?

You can call wp_update_term_count_now( $terms, $taxonomy ) (documentation) to update the term count for the specified terms (you will need to pass an array of all terms if you want to update them all). If you want to use your own function instead of the standard function (which counts all posts), you can set the … Read more

Limit tag word count

Use the pre_insert_term filter: function wpse_189722_limit_tag_words( $term, $taxonomy ) { if ( $taxonomy === ‘post_tag’ ) { if ( count( preg_split( ‘/\s+/’, trim( $term ) ) ) > 2 ) $term = new WP_Error( ‘term_too_many_words’, ‘Maximum of 2 words’ ); } return $term; } add_filter( ‘pre_insert_term’, ‘wpse_189722_limit_tag_words’, 10, 2 );

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)