Need to display author’s email id in the “Edit post” field in wp dashboard. How do I do this?

Probably you use get_post on edit page with query object. You can simply use $post->post_author on edit page. For example; $editableid = get_query_var(‘id’); $postedit = get_post($editableid); $author_id = $postedit->post_author; //Always return author ID value. <input type=”hidden” name=”post_author” value=”<?php echo $author_id;?>” /> I hope this code piece helps you. EDIT : For email you use the_author_meta … Read more

Display Random Post in Author Page

use this query in themes functions.php function ng_author_query( $query ) { if ( $query->is_author() && $query->is_main_query() ) { // your code to set $current_user_name here $query->set( ‘orderby’, ‘rand’ ); } } add_action( ‘pre_get_posts’, ‘ng_author_query’ ); Let me know if you have any problem?

How to add author on WordPress Pages? Not blog article page

WordPress has a function which does this for you. You’ll need some experiences with HTML, CSS, PHP to style the output and understand what that function does: the_author() which displays the author of the post/page. In your theme will most likely be a page.php template where you can add these on pages into The Loop … Read more

Following/Followers Users list Using Ajax Pagination inside Author Profile

The problem is this line: $curauth = (isset($_GET[‘author_name’])) ? get_user_by(‘slug’, $author_name) : get_userdata(intval($author)); First you make the ajax call with an POST-request, that is the reason why the GET array is empty. Second the variable $author is not defined. So every time you call the script, the variable $curauth is empty. A solution could be … Read more

How to allow different authors to use same post slug?

I ended up adding this code that makes the default post type hierarchical and populating the wp_posts.post_parent field with the author ID. The combination of these two has achieved the desired implementation of having the same slug across multiple authors. // Set post type “post” to be hierarchical $wp_post_types[‘post’]->hierarchical = 1; Source: https://stackoverflow.com/questions/10750931/wordpress-how-to-add-hierarchy-to-posts

Show all authors in drop down panel while choosing author for a post

The author dropdown in the post editor is generated by the function post_author_meta_box() That particular function uses the wp_dropdown_users() function to display the dropdown. The problem is that the arguments specified for the instance do not include the “show_option_all” argument. That argument should default to “all” but if you’ve got a filter on wp_dropdown_users_args somewhere … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)