Ok I figured it out:
<?php
$posts = get_field('venue');
if( $posts ): ?>
<?php foreach( $posts as $post): // variable must be called $post (IMPORTANT) ?>
<?php setup_postdata($post); ?>
<?php $vmap = get_field('venue_google_map', $post->ID); ?>
<div class="acf-map">
<div class="marker" data-lat="<?php echo $vmap['lat']; ?>" data-lng="<?php echo $vmap['lng']; ?>"></div>
</div>
<?php endforeach; ?>
<?php wp_reset_postdata(); // IMPORTANT - reset the $post object so the rest of the page works correctly ?>
<?php endif; ?>
Heya!
This is the output:
acf.fields.wysiwyg.toolbars = {
"full": {
"theme_advanced_buttons1": "bold,italic,strikethrough,bullist,numlist,blockquote,justifyleft,justifycenter,justifyright,link,unlink,wp_more,AtD,fullscreen,wp_adv",
"theme_advanced_buttons2": "formatselect,underline,justifyfull,forecolor,pasteword,removeformat,charmap,outdent,indent,undo,redo,wp_help,code",
"theme_advanced_buttons3": "",
"theme_advanced_buttons4": ""
},
"basic": {
"theme_advanced_buttons1": "bold,italic,underline,blockquote,strikethrough,bullist,numlist,justifyleft,justifycenter,justifyright,undo,redo,link,unlink,fullscreen"
}
};
Hi @exeQutor
Can you please download the latest ACF from github. There are some JS fixes for tab + conditional logic issues.
Let me know if this solves your problem.
Thanks
E
Hi @YourMark
Because your filter is creating a new WP_Query object, and using the function $apollo_home_teams->the_post();
, the global $post will be over written.
The best solutions is to not use WP_Query, but instead, use the get_posts
function and loop over the results like an array.
Thanks
E
Hi @rpk
Thanks for the request. Can you please describe how these functions would be used and where?
Thanks
E
Hi @Will
Thanks for the question.
Currently, ACF does not have the ability to insert before / after other plugins during the attachment fields filter.
Perhaps this is something that I can look at in the future, but for now you will need to manually adjust the priority of the attachment_fields_to_edit
filter.
Thanks
E
I too have a very slow edit page. However, I am NOT using repeater plugin on this page. I am using the flexible content though. Also, it gets worse and worse the more flexible content I add.
BTW, I do have the repeater plugin installed. Also, i’m on WordPress 3.8
/* After a little bit of debugging in Chrome code inspector */
Looks like there is a bunch of Garbage Collection that occurs during my 7 second freeze. Here is a screenshot: https://www.dropbox.com/s/43esgobg2jmzquq/Screenshot%202014-02-25%2009.29.37.png
Here is the timeline output for the event:
https://dl.dropboxusercontent.com/u/643924/TimelineRawData-20140225T092639.json
So what I did was click on “add new layout” for my flexible content, then choose one from the list and then it freezes. I also get lags in scrolling and just general stuff. Anything else I can do to help,just let me know.
I do have the latest versions:
ACF Version 4.3.4
ACF Repeater Field Version 1.1.1
Wordpress Version 3.8.1
I replicated my setup and I think I found the issue. I actually have conditional logic in the tabs that triggers from the checkbox field above. It is somehow affecting the whole issue.
See here: http://www.screenr.com/eQNN
Are you running latest versions of WordPress, ACF and ACF Repeater?
I did a short screencast replicating your setup, in Chrome: https://cloudup.com/i40qPzswRh1
Thanks for the response @matiasvad
However, I’ve tested this on both Chrome and Firefox but the issue still persists.
Here’s a Screenr I made: http://www.screenr.com/fQNN
If you notice in the video, the custom fields are located in the User’s profile. I don’t know if it is related to the issue.
Is it still a problem in ACF 4.3.4?
One of the bugs fixed in the new version reads:
“Post Object field: Fixed get_pages bug cuasing ‘pages’ to not appear”
ACF doesn’t save data about the Field Group, only fields inside of it.
Read on for a solution that you could use (Stack Overflow), and a statement from Elliot
Thank you @elliot for the quick reply.
Before the update to acf or wp the prepend would display on the front end. E.g. If I had “Title: ” in the prepend and “WordPress 101” in the input field. The front end would display “Title: WordPress 101”.
The displaying of the prepend of the input field is no longer happening. The “Title: ” is not displaying on the front end, just the value put in the field input.
Thanks Elliot.
Hi @uakz
Creating a checkbox input is very similar to creating a radio input. Please checkout some online tutorials to learn more about this.
I would love to help, but this question is far from a support issue, so I am unable to pride any support for this.
Good luck creating your custom page, and please feel free to ask any specific ACF related questions.
Thanks
E
Hi @bjtalbot
I’m not sure if this will work, but I have a feeling that WP replaces the curly quotes when you output the content like so the_content()
.
If this is true (most likely), then you can get WP to format your custom field in the same way like this:
$value = get_field('field_name');
echo apply_filters('the_content', $value);
let me know if that works.
Thanks
E
Hi @phil.owen
Please review the docs here: http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
You can see that a value does not have to be exact, you can compare EXISTS
which I believe will help you out.
Thanks
E
Thanks for the attachment.
Yes, the issue is definitely related to the size of the flexible content field.
The current ACF data architecture does not allow for such massive field sizes, so I am unable to help fix this issue in ACF4.
In ACF5, this will no longer be an issue, as each sub field is saved as a unique entry to the DB. This will prevent the flexible content field from becoming so big that it can’t save.
Sorry to not provide a solution as yet, but please wait for v5 to use a flexible content field at this size.
perhaps a temporary solution is to increase your server’s max_vars setting + PHP memory – http://www.advancedcustomfields.com/faq/limit-number-fields/
Thanks
E
Hi @Kevin
Perhaps the issue is that you are running a version of WP that ACF does not support.
ACF requires at lease WP 3.5 or later, and you are using 3.4.2
Can you please update WP. I believe this will fix the issue.
Thanks
E
I kinda figured this out. I added a new True/False custom field to my ‘speakers’ custom post type. Now if the box is checked, then that speaker shows up (in a separate page template for Workshop speakers). I added this to my loop:
'meta_query' => array(
array (
'key' => 'is_workshop_speaker',
'value' => '1',
'compare' => '=='
)
)
Now, only the True/False (checked) speakers are showing on my ‘Workshop Speakers‘ page which is perfect but those that are checked are still showing on my ‘Conference Speakers‘ page as well. Now my question is, how to exclude those that are checked as Workshop Speaker from my Conference Speakers page?
Thanks
Hi Elliot,
Sorry for the confusion. I was trying to say that I think the the wp object error was related to the fact that the field (in our case) never finished processing. I concluded this based on the fact that we were seeing the same result before and after the wp object fix you implemented. Once I limited the scope of the posts that field was trying to query against I wasn’t getting the wp object error and the rest of the edit page was being processed appropriately.
Hi,
yes, I’m ok, this was more of a bug-report. I think the best solution would be to filter out these characters on the automatic js filling of the field (where you lowercase, replace spaces etc.). I would never intentionally use foreign characters in a field name, but when I’m filling the fields quickly I don’t always remember to check the generated field name.
I have a script for my cms that does it while preserving the most common european characters – I’m attaching it.
Thanks for your help!
Jure
Hi @Vasili
Can you please remove any variables from the equation completely?
You can do this by harcoding the $post_id parameter of the get_field function like so:
$value = get_field('field_name', 123);
Where 123 is the post ID where you want to load the data from.
If ACF can’t load data like this, then the chosen post does NOT contain the data you expect and you will need to double check all your field names / post ID’s are correct.
Thanks
E
Hi @cinq75
This is getting quite advanced and I am unable to provide support for this custom query.
Please debug the SQL which is being generated by your WP_Query object. This will show you where any SQL logic errors are occurring.
Thanks
E
Hi @phil.owen
Your meta_query arrays are missing the value piece
Thanks
E
Hi @tarun5585
Thanks for the info.
The above is quite complicated and you will have to code this by hand.
It is possible to hook in and modify a select field’s choices. This means you CAN modify the ‘cat’ sub field to reflect all the categories added on the chosen hotel.
Please look into the acf/load_field
filter (see docs) to learn how this is possible. There is also a tutorial (on the docs) that explains how to modify a select field’s choices.
If you want, you can take it a step further and write some jQuery that listens to a change on the hotel select, and then updates the sub fields via AJAX.
I won’t be able to provide any code / help with the above as it is far to custom for this free support forum.
Good luck with the docs,
Thanks
E
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.