Author.php display profile for all types of users

You can try to catch the 404 template and redirect it to the author template which will usee the same template for all users even if they are subscribers (or any other which have zero posts) something like this: function no_404_for_all_users($template) { global $wp_query; if( !is_author() && get_query_var(‘author’) && (0 == $wp_query->posts->post) ) { return … Read more

How to create custom WooCommerce 2.0 templates

Actually, the templates folder is still included in WooCommerce, just like before. Just copy its contents to yourtheme/woocommerce and, hey presto, it works! N.B. This doesn’t work when you use the woocommerce_content() function in a woocommerce.php. WooThemes actually have a good primer page that they even link from a nag after you have installed WC2.0.

Create archives by author role

You may be able to abuse add_rewrite_endpoint for this purpose, depending on exactly what you want to do. Some examples: // add an endpoint // http:domain.com/role/ // http:domain.com/role/foo/ function wpa_add_role_endpoint(){ add_rewrite_endpoint( ‘role’, EP_ALL ); } add_action( ‘init’, ‘wpa_add_role_endpoint’ ); // check if a role parameter exists, like: // http:domain.com/role/foo/ function wpa_role_query( $query ){ if( $query->get(‘role’) … Read more

Mass post format changer?

Back-up your db Add this code to your functions.php file from your theme: $all_posts = get_posts(array( ‘numberposts’ => -1, ‘post_type’ => ‘post’, )); foreach($all_posts as $p) set_post_format($p->ID, ‘standard’); Refresh Remove the code Or with a SQL command: UPDATE `term_relationships` SET term_taxonomy_id = ‘standard_post_format_id’ WHERE term_taxonomy_id = ‘gallery_post_format_id’ Change standard_post_format_id and gallery_post_format_id with the IDs matching … Read more

if else for custom $curauth-> field

A combination of get_queried_object_id to fetch the current user ID and get_user_meta to retrieve the banner should do the trick. <?php // somewhere in your theme’s author.php if ($img = get_user_meta(get_queried_object_id(), ‘user_banner’, true)) { // they uploaded an image, use it } else { // they did not upload the image, show the default }

Avoiding page loop

I would highly recommend you to make one of those wp query calls the main query & all others as secondary queries. That will make your life much easier in the long run. If you absolutely want to disable the main query, wordpress doesn’t have a direct filter for that. You can however do a … Read more