It works ! Thank you π
Solved!
Finally I solved it !
Here is what I used, it works : https://www.advancedcustomfields.com/resources/querying-relationship-fields/.
but I have another problem :
The number of elements used in reverse query are medias, but I don’t know why i can only display 5 medias, no more. Does someone know why ?
Yes, I found another way to do it. Thanks for your time π
I paste this :
<?php echo '<pre>';
print_r( get_field('media-test') );
echo '</pre>'; ?>
“media-test” is the name of the field displayed on a media in the my media library in the admin panel.
I selected a custom post displayed in the field, but when I use the code from post object in the PHP of my custom post single template, nothing is retrieved.
The gallery field is a good way, I will use it if the first option doesn’t work.
Hi,
Thank you for your answer.
This is what I tried before posting, but this way doesn’t retrieve anything. When I debug, this is empty …
Hi @Jonathan!
Sorry for double-post..
Is my message visible for you withe the private option ?
Thank you @jonathan π
As you said, now the update button disappeared, but it doesn’t solve my problem about displaying the file uploader when the post is not published yet.
By the way, now when I publish my post for the first time (whithout file attached because the field wasn’t displayed), and then go back on my post to attach a file and click on my “Save” button, the file selected doesn’t seem to be uploaded, because when I go back to my post edit page, the field is empty.
Hi @jonathan
Yes, acf_form()
is used in another form but I don’t understand what do you mean by “set the form parameter to false so itβll be included in that form instead?” (I’m a beginner)
Yes I use acf_form_header()
above get_header()
!
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.