Order Categories by Character Count

This is probably more a question about PHP rather than WordPress, and as such may be closed as off-topic for this site. That said, you can usort() to sort an array using a custom comparison function: usort( $listings->loop[‘cats’], function( $a, $b ){ return strlen( $a->name ) – strlen( $b->name ); } ); After the call … Read more

AZ Directory posts directory index

It’s easy if all posts are shown on the same page, then you can do: $AZposts = get_posts(array( ‘numberposts’ => -1, ‘post_type’ => ‘post’, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘category’ => $cat )); $current = “”; $nav = “”; $postlist = “”; foreach($AZposts as $AZpost) { $firstletter = strtoupper(substr($AZpost->post_title,0,1)); if($firstletter != $current) { $postlist … Read more

Open everything in new tab

Looks like you are talking about the_excerpt. Following code will work, as you are looking for it: function custom_excerpt($more) { global $post; return ‘<a class=”moretag” target=”_blank” href=”‘. get_permalink($post->ID) . ‘”> Continue reading…</a>’; } add_filter(‘excerpt_more’, ‘custom_excerpt’); You will need to put it in your functions.php file.