In Wordpress there is an author.php template file that you can use to display author information. I am wondering if there is a way to create a template file to display a users information (any role), even if they are not an author to any post, but is a registered user.
By default, wordpress is handling profile page for authors only.
In your case, registered user seems any subscriber or editor also have profile page.
To handle that scenario you need to add plug-in.
User Profile Page
Ultimate Member
Related
I am using a plugin that creates a shortcode for displaying user profile data in the frontend. I needed to add extra data which I made possible thanks to ACF plugin. I have been able to follow how-tos and the ACF fields now display in the frontend. This is where I am losing it.
When I view the page that displays the profile e.g example.com/profile/user, my code instead checks fields for the currently logged-in user instead of the user that I am looking at.
I cannot use get_the_author_meta() because I am manually creating the users so using that checks back for the author and instead of returning the original author it returns mine (which is how it's meant to work anyways).
Example of how I am fetching data
get_user_meta( $current_user->user_login, 'specialty', true )
specialty is the name of my custom field which I have added for user.
How can I fetch the intended username of the user I just created?
Thanks.
Currently, I'm developing WordPress site.In that,I have to allow normal users to Login/register.After, they can post posts.After the approval of the admin, the post will be published on the site.Also, concern user wants to view, edit or delete his/her previous posts.
Is any plugin there?
Here you need to use two different plugin.
1) User Front Login / Register ::
https://wordpress.org/plugins/zm-ajax-login-register/
2) User can post from the front end ::
https://wordpress.org/plugins/ppress/
Thanks
I've created a custom field (Checkboxes) in Wordpress > Users > Profile Fields. My site is an omni site for news, so it collects news from 20 different sources via RSS, and adds them ass posts in my Wordpress site. This is how my custom field looks like:
If you're only a visitor on my front page I'll show all posts on the startpage.
If you are a logged in user; then you should be able to select and save wich of the 20 sources you want to read in your startpage on my site. This is possible to select and save today, but only from BP User Settings page:
Now, the issue with the Users Profile Settings page is:
a) I do not want to have the form in the tab "Profile > Edit". I want my form on my startpage (above the news flow, for logged on users of course) and perhaps in a widget sometime - anyhow - the most important this is freedom to place (and style) the form wherever I want.
b) The form includes fields I want to remove (Name and Description, i.e. "sources" = field name) etc.
The user on the image above has selected and saved to read news from 2 different sources on my website. The code that handles this is on the startpage in my index.php is:
$sources = xprofile_get_field_data( 'sources', $current_user_id, $multi_format = 'array' );
query_posts(array('category__and'=>array($sources)));
Question
Is there a way of retrieving this form and update in from anywhere for logged in users?
I don't want to be bound to the idea of only having the form in the Profile Settings page. I want the user to have to form above my news flow on the startpage of my site, so the users gets the feeling of "Oh, I can customize my news flow if I create an account!" - and this should be done from anywhere for logged in users.
If I am getting it correctly, you want to display the form to logged in users. Have you tried
<?php if ( is_user_logged_in() ) { ... } ?> function?
you may also wish to update user fields with
update_user_meta()
I have a Wordpress page /users and it displays a list of all users created. Each user has a link to its profile page. What I need to do is create that page. I want it to go like this /users/{user_id}-{first_name}-{last_name}, for example - /users/1-john-doe. I have a template for /users and also for profile pages. Question - how do I properly make a page with that profile template so that it would have the url described above? The page does not need to select the user automatically, it needs to pass the user slug so I can read it in that page and query for that user (as a variable or something).
Thanks.
What you are looking for is the WordPress Rewrite API.
This allows you to define a new "endpoint" for your URL's, and allows you to pick up the variable from the URL via built-in WordPress functionality.
A great article on it can be found here: Custom Endpoints
I want to load some extra author options to the profile pages of a Wordpress site, however, even though these options apply to every user, they should only be able to be modified by an admin user, therefore, is there a way to hide the options if the user is not an admin? but show them when editing other profiles as an admin user?
Thanks
This can be performed but not out of the box.
Roles and Capabilities
It is available using certain plugins
Lime PLugin