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

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 }

Show infos only to the author in the author.php

You can check who the current user is and whether they have the same ID as the user that is being viewed. global $current_user wp_get_current_user(); if(the_author_meta(‘ID’) === $current_user->ID) : // Add your code here… endif; See these Codex pages for more information – wp_get_current_user() the_author_meta()

Php markup question: php/html within conditional bit

you code may look like this <?php global $wp_query; $thepostid = $wp_query->post->ID; $postdata = get_post($thePostid, ARRAY_A); $authorid = $postdata[‘post_author’]; if ($authorid==1) { echo ‘Show nothing’; } else { ?> <div id=”author-bio”> <h3>About The Author</h3> <?php echo get_avatar( get_the_author_id() , 80 ); ?> <h4><?php the_author_posts_link(); ?></h4> <div class=”desc”><?php the_author_meta(‘description’); ?> </div> </div> <?php } ?>

Show author name not the author ID

<?php $product_pages_args = array( ‘meta_key’ => ‘_wp_page_template’, ‘meta_value’ => ‘page_library_html_content.php’, ‘hierarchical’ => ‘0’ ); $product_pages = get_pages( $product_pages_args ); ?> <?php foreach ( $product_pages as $product_page ) { $author_id = get_post_field(‘post_author’, $product_page->ID ); $author_details = get_user_by( ‘id’, $author_id ); $author_name = $author_details->first_name . ‘ ‘ . $author_details->last_name; echo ‘<div id=”posts” class=”flex_100″>’; echo ‘<div id=”library_title”><a href=”‘ … Read more

WordPress Author Information show paragraph?

Use wpautop() https://codex.wordpress.org/Function_Reference/wpautop Example <?php ///MUST BE IN A LOOP echo wpautop(get_the_author()); ///MUST BE IN A LOOP ?> So you will need to find out where author name are being displayed in the code. Normally the default file is author.php