Removing “HTTP://” From the_author_meta?

Assuming that the author’s id is $author_id, the following code should work. You can of course use this to create your own function. <?php $url = get_the_author_meta(‘user_url’, $author_id); ?> <a href=”https://wordpress.stackexchange.com/questions/26599/<?php echo $url; ?>”><?php echo str_replace(‘http://’, ”, $url);?></a>

Getting label name of extra user fields

Context: http://wordpress.org/extend/plugins/extra-user-fields/ Author URL: http://www.feweb.net/wordpressplugin_extrauserfields.htm Mentioned Functions: http://codex.wordpress.org/Function_Reference/the_author_meta http://codex.wordpress.org/Function_Reference/get_user_meta If you can already get the label BUT it comes with the input, and you are doing this in PHP, then do this: <?php # … # Your code which produces the input + label data into $data # … $document = new DOMDocument(); $document->loadHTML( $data … Read more

Checking if meta_value exists for any user

I personally try to stay away from mysql queries when I can use WordPress functions to achieve the same thing. You could try using get_users, Is this what you are trying to achieve: <?php $blogusers = get_users(‘meta_value=Referral’); foreach ($blogusers as $user) { echo $user->user_email; } ?> Untested. But that should display every user with a … Read more

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

Using and saving custom dropdown boxes on user profiles

You appear to be checking for variables that aren’t set. You set $selected $selected = get_the_author_meta( ‘user_top’, $user->ID ); But then you check for something called $topselected <select name=”user_top” id=”user_top”> <option value=”gotguns” <?php echo ($topselected == “gotguns”)? ‘selected=”selected”‘ : ” ?>>I got guns</option> The same thing happns with $middleselected and $bottomselected I think your problem … Read more