From what I understand you are trying to change the permalink structure of the user, so instead of showing yoursite.com/author/yourusername
it will show yoursite/profile/yourusername
?
You can add a rewrite rule to the permalink structure to make that change:
function yourdomain_user_rewrite() {
global $wp_rewrite;
$wp_rewrite->author_base="profile";
$wp_rewrite->author_structure="https://wordpress.stackexchange.com/" . $wp_rewrite->author_base . '/%author%';
}
add_action( 'init', 'yourdomain_user_rewrite' );
Then Worpdress will automatically load author.php
on your theme when yoursite/profile/XXXX is queried. No complicated queries involved!
Is that what you are looking for?
Related Posts:
- Getting all user metadata from user
- How to add custom query filters in WP_User_Query
- Add a default meta_value to new posts
- Filter user list that meta_value is empty
- Query wp_usermeta alongside wp_users
- SQL User Query by Multiple Roles using PHP
- WP User Query get all authors with last name starting with specific letter
- Sort users by “birthday” using WP_User_Query
- Hide Administrators From User List except current user (administrator)
- How to display user order by role
- Import wp users via one click demo option
- Dynamic User Id
- Prevent author bio page from showing in search results
- Get multiple users with meta value in one query and populate WP_User class
- Reduce number of SQL queries inside WP_Query loop to fetch author data
- Display if author page is author page of current user
- Get user first name from custom endpoint
- Storing an array of objects related to each user
- Query to get last posts from authors of blog
- Deleting terms from the WordPress wp terms table
- Query pages created by deleted users
- Query posts by post type, author and post meta
- Random users always showing same 8 users
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- Set “editor” role to existing user
- wp_insert_post with ACF Fields and WP Meta Query returns no rows until update
- How to query 5 users in random who have published more than 10 posts
- How to query users by post count no less than 10
- Merge wp-query and get_users
- Get all wp_users sort by metakey
- Logging search queries for logged-in users
- List users by Year of Birth using a foreach loop to dynamically populate years and data
- Show subscriber id in loop
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- Query Users by post count, last 30 days and display each users post count according to post type
- Get users query makes the site loading time too big?
- Get all user with both meta_value
- WP_Query orderby date not working
- How to exclude products by tag from woocommerce shop page?
- Filtering posts by custom field value not working
- wpdb get results doesn’t work with variable
- Multiple meta queries but arrange by specific meta value order
- Custom pagination with WP_Query generating 404 error
- Query post with meta_query where date is not in future
- Apply CSS class to every second database record [closed]
- pre_get_posts order by not working
- How do I change the order (ASC and DESC) in the following retrieval method using WP_Query?
- How to get all child pages in their parent page?
- how do we display all posts from a particular category in homepage?
- Display both standard posts in a specific category along with a custom post type in a single loop?
- Orderby is working with one query but not with other
- meta_query in WP_Query value is not accepting array
- How to order posts by title after they have already been sorted by category
- How to query custom post types with mixed AND & OR statements for custom fields
- Custom post type archive pagination query issue
- WP Group posts by year(desc) > month(desc) > date(asc)
- Check the Specific Meta Key IF its Meta Value is Empty then… (WP Post Meta Query)
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- Filtering posts by archive showing all years
- Apply filters to main query instead of creating new one?
- Why having more than 10 clauses in WP_Query results in some outputs being dropped?
- mysql query order by
- Content not displaying on paginated page
- show custom category posts from a custom post type
- how to load posts to a custom post template after using template_redirect or template_include
- 2 queries with counters
- Multiple Query_Posts
- Page template doesn’t display simple HTML if inserted into other page?
- Query multiple post types, but different order for each
- How to add date_query to meta_query array
- Order by the first array within a meta_query
- Multiple nested meta queries
- How to _GET multiple value checkbox WP_Query in Custom Toxonomy / Custom Fields
- Custom query for custom post type not getting correct post ID
- How to merge these two post queries?
- How to search posts by title with special characters in WP_Query?
- How can I query a radius of coordinates?
- WP_Query: Query posts only if their access is restricted to logged user’s role
- Get specific value from variable to use in query
- WP_Query with meta_query won’t orderby
- Adding Category in WP_Query Not Working
- display all posts from category with and without terms in chronological order
- How to create page that lists tags by initial letter?
- Seach and categories not working when ignoring sticky posts in main loop
- Extending WP Query: Custom geolocation meta values work, but tax_query breaks
- WordPress: Cron locking and Queue
- Correct Way To Run Multiple Queries Sharing Some Base Data
- how to query for meta_value have array
- How to make the default WordPress search return borader results
- WP_Query shows all posts on single post pages
- Show sticky post before other WP_Query
- List ALL posts within last week from current category on category page
- WP_Query on “property” in the options table
- Dynamically name array in WordPress loop – add/get values
- Creating Custom Query
- Hook to get the query result after listing posts
- Elementor custom query
- WordPress extremely slow when using get_posts with multiple meta_query relations
- Refresh wp_query with no changes
- Search results stuck on page 1