Get Comment Author ID on the fly while posting
Ah! It was so simple 😛 Just using WP built in function get_current_user_id( ) and all done. Thanks a lot.
Ah! It was so simple 😛 Just using WP built in function get_current_user_id( ) and all done. Thanks a lot.
Add this to ‘your’ section of the .htaccess file (so not in the WordPress section): Redirect 301 /author http://yourdomain.com/profile
Look for single.php in your theme directory. There you should find the_author(), you can remove that to remove a reference to the author. You will be able to find all your answers in the codex, by the way.
You’re probably better off to use get_users which returns an array of <?php // get all users, regardless of roll. If you do need to restrict by // role you can use the `role` argument: get_users(array(‘role’ => ‘author’)); $uses = get_users(array(‘orderby’ => ‘nicename’)); foreach ($users as $user) { // do stuff with $user, will have … Read more
It’s because the TwentyTwelve theme has “clear: both;” set on H3 tags, which messes up the layout. Try adding this CSS: #authorlist h3 { clear: none !important; }
Did you tried fetching the requested posts with WP_Query? $posts = new WP_Query(); $posts->query( array( ‘posts_per_page’ => -1, ‘author’ => $curauth->ID, ‘post_type’ => ‘photoshop_tutorial’ ) ); $post_count = sizeof( $posts->posts );
Use global $authordata: Testing for roles: global $authordata; if ( in_array( ‘administrator’, $authordata->roles ) ) { echo ‘Hello Admin!’; } elseif ( in_array( ‘editor’, $authordata->roles ) ) { // echo something else } Or testing for capabilities: if ( ! empty ( $authordata->allcaps[‘manage_options’] ) ) { echo ‘The author can manage options’; } elseif ( … Read more
Your question is not very detailed or very clear but get_user_meta will return all of the user metadata for a user. That should have all of your fields. You could also use get_users for the second tab. I am not dealing with the first since you state that your “have no idea how to do … Read more
I found the issue, thanks to @Toscho giving me the spark of an idea. We are using custom user roles and capabilities. It had something to do with the User Role Editor plugin. Deleted the custom role, and created a new one, reassigning all capabilities. Then updating all users to the newly created user role. … Read more
get_the_author_meta() returns the data for use in PHP. To display the information instead, use the_author_meta() http://codex.wordpress.org/Function_Reference/get_the_author_meta Your code does not echo data even if it is present. Add an echo or use the_author_meta <?php if(get_the_author_meta(‘twitter’) ): ?> <a href=”https://www.twitter.com/<?php echo get_the_author_meta(‘twitter’); ?>” target=”_blank”>Twitter</a></p> <?php else: ?> <strong>No website</strong> <?php endif; ?>