Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
David

Display title of Custom Field using its id

Hello, I have a custom post type called “Expert Insight”, this has 3 fields, title, content and author. The author field will simply be an id value, this id value will later be used on the front end to get the author name, image etc. Also there can be more than 1 author id associated to any “Expert Insight”.

If I use your plugin to include the author field as a column I only see the id(s), like this [“841”] or [“838″,”839”]. Is it possible to see the name of the author instead?

7 years, 11 months ago
Stefan van den Dungen Gronovius
Developer

What type of column did you create to show the author?
If you used the Custom Field column, you could set the Field type to Username (User ID’s). It should show you the username based on the id’s.

Can you tell me if this works for you?

7 years, 11 months ago
David

Hi, yes I used the Custom Field column, author id(s) is actually referring to another Custom Content Type called “Colleage”, the title of each “Colleage” is the name of the author. Your solution won’t work for me as I think you are referring to WordPress Users.

7 years, 11 months ago
Stefan van den Dungen Gronovius
Developer

Hi David,

Ok I understand your setup now. In the custom field you can also choose for ‘Post Title (from id’s)’. It should lookup the post title based on a post ID. In your case this should work because it is the name. This also works for array’s so I expect this works in your case.

7 years, 11 months ago
David

Okay so I have set the following values
Type: Custom Field
Custom Field: Colleague
Field Type: Post Title (Post ID’s)

But now it shows no values?

7 years, 11 months ago
Stefan van den Dungen Gronovius
Developer

Hi David,

In that case the value of the column is probably not an array.
Is it possible to have a look on your environment?
You can send the credentials to me (support@admincolumns.com) so I can have a look.

Not sure, but are you using Advanced Custom Fields to create the relation between Expert Insight and author?
In that case you could use the ACF addon (business license and up) to show the title from another post type.

7 years, 11 months ago

You must be logged in to reply to this topic.