Support

Account

Home Forums Front-end Issues Showing Author Custom Fields on Elementor

Solving

Showing Author Custom Fields on Elementor

  • hi, my name is Tony and i am currently building a news portal site. On this site, it has several people writing posts. i create a field group named Author to input additional information of wordpress user such as their position, facebook url, and twitter url. My goal is to show the author information such as name, avatar, their position, facebook url, and twitter url on the sidebar on their respective post. When i create author archive template on elementor, the advance custom fields dynamic links is working and shown every detail of the Author field group but when i create the sidebar to show the author profile and their details on their respective post, it does not show anything. The field group rules is User Role is equal to All or Post Type is equal to All. how to fix the sidebar to show the author details from advance custom fields dynamic links?

  • This is because on the “Author” page WP is querying the author, but on the single post page WP is querying the post.

    Elementor can only get values from the currently queried object, that means that on the single post page it can only get values from the post and it will not be able to get values from the user that created that post. I don’t know if this ca be done in elementor with one of their widgets, you might want to look at the “Author” widget for your single posts, but like I said, I don’t know if this widget has the ability to add custom fields.

    You might need to create custom code to do this, I do not have any examples I can point you to. It will likely mean creating a custom shortcode and in the shortcode getting getting the post ID, then getting the user (author) ID and returning the value from the ACF field for the user.

  • Thankyou for your answer, ill start with your guide and hope it works.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.