wow, that’s a really mean way to reply.
What is your problem?
Alright, I have an idea: how should I proceed if I was create a structure like this, using ACF and PHP:
1 – Set custom field as User Array or User Object.
2 – Display the following structure:
| User Avatar | User’s Name (linked to their profile).
I need it to display the same way that the avatar and name are displayed here in this support forum. If I know how proceed with php, I might be able to convert it to twig later.
I tried using:
{% for item in post_autor %}
<li><a href="{{ item.user_url }}">{{ item.display_name }}</a></li>
{% endfor %}
for the custom field, but it’s not working.
I also tried:
{% for item in author %}
<li><a href="{{ item.user_url }}">{{ item.display_name }}</a></li>
{% endfor %}
Same result.
On the other hand, when I tried:
<p class="byline">Autor: <a href="{{ post.get_field("post_autor.user_url") }}">{{ post.get_field("post_autor") }}</a></p>
it worked after I settled the type to User Object, but the URL being retrieved is the post’s url instead of the user profile url.
Since there’s too many users being listed as contributors, using “author” won’t work for all of them (I presume).
I’m totally new to timber, someone just told me the language is called twig, I’m confused.
Anyone? 🙁
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.