How to Modify Author Page for all Users?

To get the data of the user displayed on the current author archive page you can use: $author = get_user_by( ‘slug’, get_query_var( ‘author_name’ ) ); $user_info = get_userdata( $author->ID ); More info on what is returned: http://codex.wordpress.org/Function_Reference/get_userdata From there you can use the user details you need: <?php echo $user_info->user_firstname . ‘ ‘ . $user_info->user_lastname; … Read more

Pagination for custom query throws 404 errors on last pages [duplicate]

Exactly what @Pieter Goosen said. Not only are you creating havoc for WordPress, you’re adding unnecessary load on the server by introducing more queries on top of the main query: function wpse_176933_custom_authors_archive( $wp_query ) { if ( $wp_query->is_main_query() && $wp_query->is_author() ) { $wp_query->set( ‘posts_per_page’, 4 ); $wp_query->set( ‘post_type’, ‘publikasjoner’ ); $wp_query->set( ‘meta_key’, ‘rapportnummer’ ); $wp_query->set( … Read more

Author page from blog post

I can’t give you an exact contextual answer because you have not provided your code, however the functions (with example usage) listed below should do what you require. On each blog post on the index.php page I want to display the authors name and image. Inside The Loop you can get the name of the … Read more

Missing content on author archive page

Fixed. I used code: <div class=”panel callout radius”> <?php echo get_avatar( get_the_author_meta( ‘user_email’ ), ’96’ ); ?> <div class=”right”> <a href=”https://twitter.com/<?php the_author_meta( ‘twitter’ ); ?>” target=”_blank”><i class=”fi-social-twitter size-24″></i></a>&nbsp; <a href=”<?php the_author_meta( ‘facebook’ ); ?>” target=”_blank”><i class=”fi-social-facebook size-24″></i></a>&nbsp; <a href=”mailto:<?php the_author_meta( ’email’ ); ?>”><i class=”fi-mail size-24″></i></a> Then I found out this function could only be used … Read more

Display content based on Author Custom Post type

Based on the description of your issue it sounds like there is one key piece of information missing. When the form is submitted you need to insert a custom meta value in wp_usermeta that will create a relationship between the new user and the corresponding custom post type. Lets call it meta_key = ‘user_post_id’ for … Read more

Allowing comments on author pages

Please have a look here: https://codex.wordpress.org/Function_Reference/comment_form unless I’m mistaken, you will need to add this to your author.php file. If your using a theme that gets updated your will have to make a plugin out of it. <?php comment_form( $args, $post_id ); ?>

Right way to display the_author_meta fields?

I would actually load them into an array: $author_contact = array( ’email’ => get_the_author_meta( ’email’ ), ‘telephone’ => get_the_author_meta( ‘telephone’ ), ‘twitter’ => get_the_author_meta( ‘twitter’ ), ); Once you have that created, you can iterate through it using a foreach() loop: <ul class=”author-contact”> <?php foreach( $author_contact as $contact => $address ) { if( isset( $contact … Read more