In the development of ordinary WordPress theme, we have ready-made theme can refer to, but the development of WordPress front-end user center, we are not easy to find a reference, probably because WordPress front-end user center needs no common theme The This article will introduce some of the development of WordPress front-end user center users often to some data acquisition method.
Global variables:
- $authordata
- $post
- $wp_query
Get the author archive page link
- echo get_author_posts_url( $authordata->ID );
Get the author’s nickname
- echo esc_attr( $authordata ->display_name )
Get the number of comments, use in loop:
- echo $post->comment_count
Get comment link, loop use:
- comments_link()
Get the current login user information
- $current_user = wp_get_current_user();
Gets the user information that needs to be operated
- global $wp_query;
- $author = $wp_query->get_queried_object();
Above is the development of front-end user center wordpress time often used in some of the data acquisition method, of course, this is only part of which I will be in the development of front-end user center when the accumulation gradually added for your reference.