Echo text if field under user_meta is empty with get_users()

When you have that much code to output concatenating it into one string like that makes it very difficult to read for others and yourself, also, to debug when things go wrong. Try this method for concatenating your output, $blogusers = get_users(‘role=contributor&orderby=display_name’); foreach ($blogusers as $user) { $name = $user->display_name; $url = get_author_posts_url($user->ID, $author_nicename); $class … Read more

How to create an identical second loop for attachments?

You don’t need a second loop. Just save all the data you need later during the first loop. Sample code, not tested, just a hint: <ul class=”ei-slider-large”> <?php // Here we store the data. $second_loop = array(); // Main loop $main_query = new WP_Query( array( ‘category_name’ => ‘featured’, ‘posts_per_page’ => 3 ) ); if( $main_query->have_posts() … Read more

limit posts per page

I changed the first line of my code to this and it worked to limit the posts $allcats = get_categories(array(‘child_of’ => get_query_var(‘cat’), ‘number’ => 3,’order’=> ‘asc’)); Now on to the next problem…Pagination

Missing thumbnails

Seems to me you use a WordPress theme which uses some kind of php library to resize images. You should really use WordPress default add_image_size() and wp_get_attachment_image but if you were the one who created the theme you would already know that. There are 3 things you can do: find a new theme that is … Read more

local WAMP admin user has lost privileges

This sounds like a Folder Permissions problems – the MAMP Apache user needs to have read/write privileges on everything under your Sites/wordpress/ folder. This is easy to do from the terminal … my post on Permissions should help can i run wp as root permissions

Rename page URL

I have tried some add_rewrite_rule magic and query variables and it worked. Thanks for the help everyone. If in case anyone want to refer the answer: add_filter( ‘query_vars’, ‘wpse26388_query_vars’ ); function wpse26388_query_vars( $query_vars ){ $query_vars[] = ‘custom_gallery_id’; return $query_vars; } add_rewrite_rule( ‘topic/([^/]+)/([^/]+)/gallery/([0-9]+)/?$’, ‘index.php?pagename=gallery&custom_gallery_id=$matches[3]’, ‘top’ ); I was able to solve my problem with this.