Taxonomy order exception for specific term

Here is the example of get_terms in the Codex: $terms = get_terms(“my_taxonomy”); $count = count($terms); if ( $count > 0 ){ echo “<ul>”; foreach ( $terms as $term ) { echo “<li>” . $term->name . “</li>”; } echo “</ul>”; } Lets say there was an ‘other’ term in my_taxonomy. To place it at the end … Read more

WordPress | Date not always appear [duplicate]

Use get_the_date() instead, here’s note from the_date() codex page regarding the issue: When there are multiple posts on a page published under the SAME DAY, the_date() only displays the date for the first post (that is, the first instance of the_date()). To repeat the date for posts published under the same day, you should use … Read more

Exclude some authors from query

Hey use this to grab all users excluding users with ID – 1,2,4 $blogusers = get_users(array(‘exclude’ => array(1,2,4))); Note – The function get_users_of_blog() is depricated, so it’d be good idea to use get_users() function which supports excludeing of users by their IDs.

Is there a better way to pull in custom content without querying posts?

It’s not a hack, this is what databases are designed for- querying large quantities of data. If you’re concerned about load, you should employ caching on data that doesn’t change frequently. That said, you should not be using query_posts to create additional queries. Really, you shouldn’t be using query_posts at all. Create additional queries via … Read more

how can i change WP main archives loop to sort by name or title

Use pre_get_posts to do any alterations of the main query. The main query happens before the template is loaded, using query_posts just overwrites that original query, which is a waste of resources: function wpa82795_archives_orderby( $query ) { if ( $query->is_archive() && $query->is_main_query() ) { $query->set( ‘orderby’, ‘title’ ); $query->set( ‘order’, ‘asc’ ); } } add_action( … Read more