What are allowedposttags and allowedtags?

These are arrays that are used by the wp_kses library. Basically they are white lists of html tags and attributes that WordPress allows in posts and comments. If memory serves correctly, “allowedposttags” is used for sanitizing post_content while “allowedtags” is used for comments.

Apply class to the a tag link generated in post tag links

The function get_the_tags(); is probably what you are looking for. The following code displays a list of tags with links to each one and a specific class for each tag: <?php $tags = get_the_tags(); $html=”<div class=”post_tags”>”; foreach ($tags as $tag){ $tag_link = get_tag_link($tag->term_id); $html .= “<a href=”https://wordpress.stackexchange.com/questions/57011/{$tag_link}” title=”{$tag->name} Tag” class=”{$tag->slug}”>”; $html .= “{$tag->name}</a>”; } $html … Read more

Is it possible to filter get_adjacent_post() with tags?

get_adjacent_posts() has several filters for components of generated SQL query, including: get_{$adjacent}_post_join get_{$adjacent}_post_where Where $adjacent can be next or previous. Source. So there is no easy way to flip it from categories to tags, but you can manipulate SQL query and add own conditions (or change to them completely).

Getting an ordered list of tags – via wp_tag_cloud or not?

one possibility: using the ‘format=array’ and ‘echo=0’ parameters; and building a foreach loop to output each tag: <ol> <?php $wptc = wp_tag_cloud(‘smallest=12&largest=12&orderby=count&order=DESC&format=array&unit=px&number=5&echo=0’); foreach( $wptc as $wpt ) echo “<li>” . $wpt . “</li>\n”; ?> </ol>

Change tooltip in tag cloud

The argument topic_count_text_callback cannot do what you need, because it doesn’t get the term ID and the taxonomy as arguments. This should be fixed in core. I think I will write a patch for that later. Update: I have written a patch for Ticket #21198. The milestone is 3.6, so the following answer will be … Read more

How to remove Tags: text from the_tags?

Use something like <?php the_tags(”, ‘, ‘, ‘<br />’); ?> From WordPress codex for the_tags(): <?php the_tags( $before, $sep, $after ); ?> Parameters $before (string) Text to display before the actual tags are displayed. Defaults to Tags: $sep (string) Text or character to display between each tag link. The default is a comma (,) between … Read more

Query all posts with specific tag

It’s a lot easier to create a new WP_Query than it is to try clearing or overwriting the original. If $post_tag is a tag slug, you could simply use: <?php $the_query = new WP_Query( ‘tag=’.$post_tag ); if ( $the_query->have_posts() ) { echo ‘<ul>’; while ( $the_query->have_posts() ) { $the_query->the_post(); echo ‘<li>’ . get_the_title() . ‘</li>’; … Read more

How do I change the output of get_the_tag_list()?

So, from the get_the_tag_list() Codex entry: $before (string) (optional) Leading text. Default: ‘Tags: ‘ $sep (string) (optional) String to separate tags. Default: ‘, ‘ $after (string) (optional) Trailing text. Default: None Since you’re using this example: get_the_tag_list(‘<ul><li>’,'</li><li>’,'</li></ul>’); …edited to save space… Modify it as such: get_the_tag_list( ‘<ul><li><span>’, ‘</span></li><li><span>’, ‘</span></li></ul>’ ); …should get you what you’re … Read more

Remove a particular tag name from the tagcloud

First: Don’t touch the core files, they will be overwritten during the next update. There is already an argument for exclusions available: exclude. It expects a term id. Sample: wp_tag_cloud( array ( ‘exclude’ => 54 ) ); Sometimes you don’t know the ID, but you can get it if you know the slug: $args = … Read more