This explains what I am trying to achieve:
Hey guys,
Does anyone have any idea on how I can achieve what I am after? 🙂
Also, I saw in the changelog for the latest update (5.7.9) there is a line that says:
* Dev – Added filter ‘acf/connect_attachment_to_post’ to prevent connecting attachments to posts.
Does this mean that it is possible to create a query that pulls images from the media library to display on a page, keeping it connected to the post they are attached to? In this way, when you click on the image it could take you to the post they are attached to?
Thanks!
Hello Mark,
Any chance you can look at my other post https://support.advancedcustomfields.com/forums/topic/gallery-field-query-filtering-by-taxonomies/
And /or a support ticket I sent for the same issue.
Thank you!
It worked as you suggested Mark 🙂
Thanks so much for your help!
Yes, unfortunately nothing is showing. I’m using a page builder and inserting a code block where I input:
<?php
$term = get_field('category_insect_family');
if( $term ): ?>
<h2><?php echo $term->name; ?></h2>
<p><?php echo $term->description; ?></p>
<?php endif; ?>
Result is blank with any option (ID or Object) for Custom Field = Family (insect_family).
If I change:
$term = the_field('insect_family');
I get the category ID value – if field is setup to return ID. When I change it to object this goes blank again.
Any hints?
I’ll try again and will let you know. Thank you! 🙂
Oh yes, I see what you mean now. Yes, it is still not working. It is not retrieving the value regardless of what option I choose there. It shows blank.
Maybe it is because only the ID for the category is stored in the post and the value in the category?
Thank you Mark.
Unfortunately I am a beginner coding and I am not sure what you mean exactly. Could you please expand a little bit? Is there any documentation you can point me to, or code example I can try to analyse to see if I can reproduce what you are suggesting?
Thank you for trying to help me 🙂
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.