get_the_author_meta not working

In the “homepage” code you posted, you have get_the_author_meta commented out. <?php /*?><img src=”https://wordpress.stackexchange.com/questions/77403/<?php echo esc_attr( get_the_author_meta(“author_pic_sidebar’, $user->ID ) ); ?>” alt=”” /><?php */?> That is why it doesn’t work. See that <php /*?> right at the beginning of the line?

Author’s Id from wp list authors function

You can use the following: // prepare arguments $args = array( // search only for Authors role ‘role’ => ‘Author’, // order results by display_name ‘orderby’ => ‘display_name’ ); // Create the WP_User_Query object $wp_user_query = new WP_User_Query($args); // Get the results $authors = $wp_user_query->get_results(); // Check for results if (!empty($authors)) { echo ‘<ul>’; // … Read more

Create an Author Page on Registration

Interesting question, though I have to say it’d be way easier to solve this with a membership plugin – I assume you don’t want that. I have found this plugin which hasn’t been updated for over 2 years, however the author.php template hasn’t changed much since then. The only way to do this is either … Read more

Get all media files for current author

Media are just posts – so just query posts. This is untested: $args = array( ‘author’ => $author_id, ‘post_type’ => ‘attachment’, ); $query = new WP_Query( $args ); I’m not sure if you want currently logged in user or the author of the post currently in the loop – either way you can set $author_id … Read more

Remove author bio from posts of a specific author

In my theme with raw codes, Post Meta Data are shown like: <div class=”entry-meta”> <span class=”meta-prep meta-prep-author”><?php _e(‘By ‘, ‘your-theme’); ?></span> <span class=”author vcard”><a class=”url fn n” href=”https://wordpress.stackexchange.com/questions/110649/<?php echo get_author_posts_url( false, $authordata->ID, $authordata->user_nicename ); ?>” title=”<?php printf( __( ‘View all posts by %s’, ‘your-theme’ ), $authordata->display_name ); ?>”><?php the_author(); ?></a></span> </div><!– .entry-meta –> It displays … Read more

Different posttypes for different authors

You don’t say how you have set up the different adsense. I will assume that in your template there is a folder, called ‘authors-ads’, in it you have some php files, named after your authors ids, e.g.: /authors-ads/author-1.php /authors-ads/author-12.php and so on. after that in your single.php or whatever template you use to display posts … Read more

Display A list of Admins

Use get_users function it allows you to query user by role. For contributors, $contributors = get_users(‘role=contributors’); foreach($contributors as $contributors){ // do something with contributors } For Admins, $admins = get_users(‘role=admin’); foreach($admins as $admins){ // do something with admins } replace role=* with your desired roles.

Declare global var from Template File and use it in Functions.php

You can use the exact same filter in your template files. If you do need it in functions.php for any reason (maybe you have some additional processing) then you can use your own custom filter. functions.php: function my_custom_authorpage_title( $title ) { // process … return apply_filters( ‘my_title’, $title ); } add_filter( ‘wpseo_title’, ‘my_custom_authorpage_title’ ); author.php … Read more