How to include post count in this “get_tags” snippet

where exactly? example below is for the count getting shown in brackets after the tag name, outside the link: <?php $tags = get_tags(); if ($tags) { foreach ($tags as $tag) { echo ‘<li><a href=”‘ . get_tag_link( $tag->term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $tag->name ) . ‘” ‘ … Read more

Create a separate widget for both Tags and TagsCloud?

we can create by category and we conver to custom category widget. There are a few plugins that are supposed to enable filtering tags for specific category. For example: TDO Tag Fixes and Sensitive Tags. //Getting Tags for a Specific Category <?php query_posts(‘cat=1&posts_per_page=-1’); if(have_posts()): while (have_posts()) : the_post(); $all_tag_objects = get_the_tags(); if($all_tag_objects){ foreach($all_tag_objects as $tag) … Read more

Tags Sorted By Characters?

You can use wp_get_post_terms to achieve this. The third argument for this function supports an orderby parameter which defaults to name i.e. to sort alphabetically by name $args = array(‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘fields’ => ‘all’); // orderby also supports ‘count’, ‘slug’, ‘term_group’, ‘term_order’, and ‘term_id’ The first 2 arguments of that function … Read more

HTML5 Summary tag in editor

You can use the $allowed_tags global. Add the following to your functions.php file. global $allowedtags; $allowedtags[‘summary’] = array(‘class’ => array()); Add more attributes within the array similar to the class element. You can learn more on Otto’s post here:

Get TOP x Tags from selected posts

With an array containing the post IDs its easy $post_ids = array( 167, 774, 787, 358 ); $tag_all = array(); foreach ( $post_ids as $post_id ) { $tags = wp_get_post_tags( $post_id, array() ); foreach ( $tags as $tag ) array_push( $tag_all, $tag->name ); } $result = array_count_values($tag_all); arsort( $result ); $result = array_slice( $result, 0, … Read more

WordPress editor, change code wrap (bbpress?)

put this code in functions.php add_action(‘wp_footer’,’ravs_codeTag_fix’); function ravs_codeTag_fix(){ if ( bbp_use_wp_editor() ) : ?> <script> jQuery(document).ready( function() { /* Use <code> instead of backticks for the Code button in the editor */ if ( typeof( edButtons ) !== ‘undefined’ ) { edButtons[110] = new QTags.TagButton( ‘code’, ‘code’, ‘<code>’, ‘</code>’, ‘c’ ); QTags._buttonsInit(); } }); </script> … Read more

Create three unique tag page templates

If you really want to use a singular tag.php file, you can run a regex on your $_SERVER[‘HTTP_REFERER’] value to determine where you’re coming from and then load a template part depending on the result, just be sure to have a default in there. Sorry, I can’t be more specific on the regex without knowing … Read more