Skip to main content

Questions tagged [author]

'Author' in the WP context can refer to two different things: the person who has written a certain post/page or the role a user has.

Filter by
Sorted by
Tagged with
16 votes
3 answers
27k views

Change the Author Slug from Username to Nickname

Hi to the community, is it possible to change the default username slug to nickname if is available? By default the url is something like: http://domain.tld/author/(admin) , is it possible to ...
Philip's user avatar
  • 2,019
24 votes
3 answers
19k views

How to check if a user (not current user) is logged in?

I need to display the online status (online/offline) for each author page (custom author page template). is_user_logged_in() only applies to the current user and I can't find a relevant approach ...
Dominor Novus's user avatar
5 votes
1 answer
3k views

Help to condense/optimize some working code

WordPress by default shows ALL posts to users who are Authors. I wanted Authors to only be able to see their own posts so I came up with the following code which works well. Any suggestions to ...
Paul's user avatar
  • 958
2 votes
1 answer
2k views

Show only oldest post by author

I am working with a heavily customized install of WP. I've set up a specific post type, taxonomy, and roles that gets to use just that post type. Ideally, I'd like to restrict members of that role ...
Adam Rice's user avatar
  • 291
16 votes
8 answers
17k views

Select subscriber as author of post in admin panel?

I want to be able to select a subscriber an author of a post in the admin so it displays their name as having written the post, but I do not want to give them any additional privileges (if they login ...
fxfuture's user avatar
  • 1,337
4 votes
2 answers
1k views

Different permalink for posts and authors

I tried to avoid ask this question, because I think that must be simple, but after long hours trying to get an answer I cant achieve it. I am trying to get a permalink structure like this: http://...
Masta's user avatar
  • 55
4 votes
2 answers
2k views

How to set author for post AND post attachments

I have multiple author accounts on one of my WordPress installs. Often I will create a post, and set the author to be a different account. However, when I upload images into that post, their ...
Ryan's user avatar
  • 696
4 votes
1 answer
2k views

How to add author details in the post sidebar?

I would like to add author details in the sidebar instead of bottom of the post? Can anyone tell me how to do that? As of now i'm using like this in the loop <?php $curauthor = ...
PrivateUser's user avatar
  • 3,459
3 votes
3 answers
2k views

Query to return maximum of one post per author

We are introducing a "featured author" area on our site and would like to display the most recent articles by a select group of authors. However, we only want a maximum of one post per author to ...
Peter Willis III's user avatar
2 votes
5 answers
7k views

Show author archive pages for authors with no posts

I have one page for each author, but if the author doesn't have any posts I can't get its variables, because the loop is empty. The page returns empty, no avatar, no info and stuff, the whole site is ...
honk31's user avatar
  • 1,388
19 votes
8 answers
66k views

How to get Author ID outside the loop

I can't get the post author ID outside the loop to make the get_the_author_meta work. So far I've tried different approaches: 1. $author_id=$post->post_author; 2. global $post; $author_id=$post-...
Marce Castro's user avatar
11 votes
1 answer
10k views

How can HTML be allowed in Author Bio?

Is there a way to prevent WP from stripping the HTML from the author bio? I need it to keep my paragraphs. Thanks in advance! :) Edit - Although this question has been answered, I will clarify that ...
5t3ph's user avatar
  • 900
7 votes
3 answers
11k views

Possible to search by author name with default WordPress search function?

I realize improving WordPress's search function is a huge can of worms, but the ONLY additional thing I need it to do is to show results when I search for an author's name. For example, if we have an ...
zack's user avatar
  • 211
5 votes
4 answers
5k views

Author page: Comments and Ratings?

I have a mult-author site where the author page gets high traffic. People want to know more about them. I have modified the author page to show more info, some custom fields, etc. but what I'd ...
RodeoRamsey's user avatar
  • 1,707
3 votes
1 answer
1k views

How to set up sub-categories for author pages?

I am setting up Wordpress for a school. They want to enable teachers to have their own section of the site where they can create posts in different categories (assignments, events, etc). I know that ...
jessegavin's user avatar
  • 3,456
2 votes
1 answer
3k views

Including post_type = 'wiki' in author archives

For a user with wiki-update permission only, I want to list their wiki articles in the author archive page. Currently, it comes back with "NOT FOUND Apologies, but ...". I am using the Twenty-ten ...
Stevarino's user avatar
2 votes
2 answers
3k views

Change destination author link

It's possible change the destination of the normal author link to a post page or other link inside the website? I have found this answer but needed do buy php code. Is possible found easier way, form ...
Marco Romano's user avatar
1 vote
1 answer
1k views

Allow authors to post only in categories they create in WordPress

I'm looking for a way to allow users with an assigned WordPress role (in my case, author) to create new categories and then automatically be restricted to only posting in those categories or the ...
Mandie's user avatar
  • 13
1 vote
1 answer
3k views

Author url rewrite

The default author permalink is: http://domain.com/author/{username} How can I do something like this ? http://domain.com/author/{username}/songs http://domain.com/author/{username}/books http://...
Robert's user avatar
  • 11
1 vote
1 answer
86 views

Function to check if author has posted within the last x days

Is is possible to check whether an author has posted in the last X days? I am currently using this function to determine whether he has posted at all. $args = array( 'post_type' => '...
JoaMika's user avatar
  • 678
1 vote
1 answer
4k views

Show the title of the latest post by author

I have the following function which I use to show the author name,author avatar and the author biography in a div. I need to show the title of the latest post by the author along with this. Can anyone ...
MidhuN's user avatar
  • 507
0 votes
2 answers
2k views

How to Change Author Posts URL

How can I display an authors archive by author id instead author slug like http://example.com/author/author_slug/ to http://example.com/author/123/
Anjum's user avatar
  • 974
0 votes
1 answer
196 views

how to make author to write comment on only his own posts?

i want restrict my registered authors to write comment to other posts except his own posts. Is it possible? I have no idea how to do it. May be need conditional logic but how?
Ramin Mahmudov's user avatar
0 votes
1 answer
700 views

How to make a relationship between books and authors?

I have a book category, but now I would like each book could be concatenated with the author profile page. And the tab for the author to show, in addition to text, the list of books he has written. ...
Mike's user avatar
  • 121
0 votes
2 answers
811 views

Show Custom Post Type by Author

I would like to set up a function in my functions.php file in a theme so that when a custom-post-type is being viewed, if the user clicks the author name in the post, it only shows CPTs by that author,...
pjk_ok's user avatar
  • 908
19 votes
3 answers
36k views

How to get a buddypress user profile link and a certain user profile field for the current post author?

I want to replace get_author_link() and get_the_author_meta($feld) with something equivalent to point to the author of the current post Buddypress user profile page and retrieve a specific profile ...
unfulvio's user avatar
  • 1,814
14 votes
4 answers
6k views

Override default url for author pages?

So the default url to display a list of posts by a particular author looks like this: http://domain.com/author/{username} I am wondering how to change the 'author' in that url to something else? I ...
jessegavin's user avatar
  • 3,456
14 votes
3 answers
23k views

Echo author ID in author.php

This is probably a super simple question. But how do I echo the ID of a user on author.php? I've tried the_author_meta('ID') But it didn't seem to want to work. I want to echo it at the end of a ...
Dean Elliott's user avatar
11 votes
1 answer
18k views

Woocommerce: assign an "author" to a product

I'm developing my first theme for woocommerce. I need to be able to have "authors" (really "designers") assigned to woocommerce products. Is that feasible? I was thinking of using the wordpress ...
pixeline's user avatar
  • 2,857
10 votes
2 answers
21k views

Programatically change post author

Given a user id, $user_id, and post id, $post_id, how can I programatically update a wordpress post author? Note: these posts are already created and the author cannot be set upon creation. Another ...
italiansoda's user avatar
9 votes
3 answers
9k views

Change author permalink

The original urls for users look like /author/login/ Is it possible to replace login by user's id? In my dream urls should become to /users/34/ (34 is user id). Thanks.
ilovewordpress's user avatar
9 votes
2 answers
8k views

Extend WordPress search to include user search

There is many a WordPress plugin out there that enhances WordPress search but I have yet to find a plugin that will add user search. Search Everything used to have the functionality but was removed ...
Scott's user avatar
  • 12.3k
7 votes
1 answer
7k views

How to display a public profile page for registered users with custom slug?

I have a website where users can register, login and their edit profile, they can comment but not post. What I am looking for is a way to display a user profile page (where I display the gravatar and ...
Andycap's user avatar
  • 585
6 votes
5 answers
7k views

Prevent Authors from viewing each others Posts

I am setting up a site where there will be multiple users as Author, the owner doesn't want the authors to be able to view each others posts, since there are some meta fields with information he'd ...
Chuck's user avatar
  • 523
6 votes
1 answer
1k views

Display Random Author with Details in Sidebar

PHP newbie here, recently decided to have a stab at cobbling together a kooky little 'Random Author Spotlight' feature into my current WordPress theme. I'm almost done, but I've hit something of a ...
Steve's user avatar
  • 61
6 votes
3 answers
5k views

How to let contributors to create a new revision(draft) editing their published posts

I'm using a custom post type to let contributors have a personal page on the site. Any time a user registers on my site a script creates a custom type post that has the registering user as the author....
bluantinoo's user avatar
6 votes
2 answers
8k views

Publish author posts only with editor approval?

I run a multi author blog and i am looking for a non plugin solution. The default author user role in Wordpress can publish posts without any approvel - look at Role Capabilities Wordpress Codex. ...
NewUser's user avatar
  • 557
5 votes
5 answers
5k views

the_author_posts_link() for authors of custom post types

I have both regular blog posts and a custom post type in a blog. The page template shows the author posts link. If you click on that link for an author that has authored some posts, that page (blog/...
Tom Auger's user avatar
  • 7,066
4 votes
1 answer
3k views

Custom loop for custom post type for current author

I need to edit the below code to only display posts for the current logged-in user/author. It is currently within a Wordpress theme page template file and works well. Any help would be appreciated as ...
Kay's user avatar
  • 53
4 votes
4 answers
3k views

Adding %author% in custom post type URL structure?

I'm trying to do some WordPress URL rewriting ... Specifically I have custom post type that currently works like this: http://mydomain.com/videos/post-title/ But I would like to have it located at: ...
Thomas's user avatar
  • 487
4 votes
2 answers
3k views

How to force listing contributors in authors dropdown menu

I am aware that contributors cannot publish posts, and that by design WP will not show contributors in the author dropdown list (this has been discussed here: Contributors missing from author dropdown)...
Riccardo's user avatar
  • 961
3 votes
2 answers
38k views

How to display posts by current user/author in a custom page template?

I am a trying to create a dashboard like custom page template that list post of of the current logged in user. I've tried to find a solution on the net. but none were appropriate
nickfrancis.me's user avatar
3 votes
1 answer
997 views

Completely hide user info

I'm wondering if there's a way to make 100% sure a user's info is not available to the public. Our theme is not currently using a profile page, but I did notice that there is a 'Posts by author' page ...
Daniel's user avatar
  • 145
3 votes
1 answer
5k views

How to hide/redirect the author page

I have a website where I let people subscribe. I would like to only show the author page for actual authors who have written a post. I wrote this code that checks for post the problem is I can't use a ...
Brooke.'s user avatar
  • 3,893
3 votes
1 answer
1k views

Root level category, tag, author and archive pages to work

I want root level Wordpress urls to work for category, tag, author and archive page. For example right now categories pages are. domain.com/category/cat-name/ it shows posts under cat-name category. ...
Robert hue's user avatar
  • 8,516
3 votes
3 answers
3k views

Query posts distinct authors

I am trying to get post from a category ordered random, but making sure that the author does not repeat itself. So I have this query which works as intended, but there is the chance that the author ...
CiprianD's user avatar
  • 264
3 votes
1 answer
2k views

Is there a way to prevent author change when editor/administrator edits a post?

As an administrator when I change or edit a post of an author (for example add a category through quick edit) the author of the post changes. We do not want this to happen. Is there a way to prevent ...
spinodal's user avatar
  • 133
3 votes
3 answers
5k views

Get attachment ID of author_meta image - Attachment Metadata

I've created a custom field in user profile where upload a profile image. It's very simple. To create fields I've used: add_action( 'show_user_profile', 'cover_image_function' ); add_action( '...
middlelady's user avatar
3 votes
2 answers
3k views

Order the users by the date of their latest post

I use the following code for getting the authors of in my multi-author blog and order them by their post count. I want to order them by the date of their last post $authors = get_users('role=author&...
Midhun's user avatar
  • 33
3 votes
1 answer
5k views

Displaying custom post types in author.php

I am trying to modify my author.php page so that it includes the custom post types which the author has added. The below is what I have where it first displays the normal posts, and then displays the ...
Theo Leep's user avatar