
I have no idea. I have never worked with wordpress.com hosting.
The reason I asked about other ACF addons is that I have run into some in the past that cause a premature initialization of ACF that in some cases could cause the issue that your are seeing. The order of plugin initialization can change based on plugin activation order and this includes when they are updated. So, if there is a plugin that is causing premature initialization this could change and seem random based on the last plugin that was updated/activated.
Premature plugin initialization could also happen in the theme.
Basically, premature ACF initialization can happen whenever an ACF function is called before the acf/init action. This action happens on the WP init action at priority 10. The order that init actions happen at a specific priority is based on when they are added, which is also a function of the order that the plugins are loaded which is a result of activation order. This does not happen with all ACF function calls. Basically if a function is called before ACF has been initialized and that function requires ACF to be initializes then ACF will try to initialize then, but there are some things that will not work if this happens too early.
Most of the time when I’ve seen this happen it has been with plugins that add new ACF fields or modify existing ACF fields.
John, thank you for the tips, but I think my knowledge is too little. Is it more or less like this?
$now = date('Y-m-d H:i:s');
$meta_query = array(
'meta_query' => array(
'relation' => 'OR',
array(
'event_start' => array(
'key' => 'start_date',
'compare' => '<',
'value' => $now,
'type' => 'DATETIME'
),
'event_end' => array(
'key' => 'end_date',
'compare' => '>',
'value' => $now,
'type' => 'DATETIME'
),
),
array(
'event_upcoming' => array(
'key' => 'start_date',
'compare' => '>=',
'value' => $now,
'type' => 'DATETIME'
)
),
array(
'event_past' => array(
'key' => 'end_date',
'compare' => '<',
'value' => $now,
'type' => 'DATETIME'
),
),
),
);
$query->set('meta_query', $meta_query);
$query->set(
'orderby',
array(
'event_start' => 'DESC',
'event_end' => 'DESC',
'event_upcoming' => 'DESC',
'event_past' => 'ASC',
)
);
$query->set('order', 'ASC');
I have no ideas anymore and I am broken 🙁
Thank you very much for your answer.
Eventually I’m done with the code below:
$now = date('Y-m-d H:i:s');
$meta_query = array(
'meta_query' => array(
'relation' => 'OR',
array(
'event_start' => array(
'key' => 'start_date',
'compare' => '<',
'value' => $now,
'type' => 'DATETIME'
),
'event_end' => array(
'key' => 'end_date',
'compare' => '>',
'value' => $now,
'type' => 'DATETIME'
),
),
array(
'event_upcoming' => array(
'key' => 'start_date',
'compare' => '>=',
'value' => $now,
'type' => 'DATETIME'
)
),
array(
'event_past' => array(
'key' => 'end_date',
'compare' => '<',
'value' => $now,
'type' => 'DATETIME',
),
),
),
);
$query->set('meta_query', $meta_query);
$query->set(
'orderby',
array(
'event_start' => 'DESC',
'event_end' => 'DESC',
'event_upcoming' => 'ASC',
'event_past' => 'DESC',
)
);
$query->set('order', 'DESC');
And I was able to get that order:
1. ONGOING EVENTS
2. PAST EVENTS
3. UPCOMMING EVENTS
Is it not possible to use WP_Query for PAST EVENTS to be last?
Are there any other ways?

You will not be able to get the order that you want.
you are first ordering events by start
event_start' => 'DESC',
then by end
'event_end' => 'DESC',
the following two orderby values will have not effect because you are trying to order by the same values that have already been used to order the values.
1 and 2 are not an issue, but placing past events after upcoming events will be impossible using WP_Query.

I gave you a link that explains the post id to use for users
https://www.advancedcustomfields.com/resources/how-to-get-values-from-a-user/
it is “user_” plus the user’s ID "user_{$user_id}"

The field is not located on the same page where you are showing it. You need to supply the correct $post_id value.
[acf field="field_name" post_id="123"]
You are trying to get fields from a user.

In the case of the code provided you need to close PHP before the HTML portions and open PHP again after
?>
<div class="member-meta">
........
</div>
<?php
Just a quick note to say that I used the same code on a non-custom post type (the simple single.php that comes with Kadence theme) and I get the same error.
Hi John, sorry for the late reply as I just saw your email today.
Now I have tried to make something with 2 plugins (JetEngine and Jet Smart Filters from CrocoBlocks) and they are nice, but still I need more features which aren’t available with this. Though by using then now I have more idea of CPT. Plus now I have a live example of my requirement to share with you. Please have a look.
So our test website is: https://wordpress-490485-2085818.cloudwaysapps.com/
– Aim is to built a website and then turn in into a Mobile app.
Here please open AVAILABLE TAXI page : https://wordpress-490485-2085818.cloudwaysapps.com/page-1-available/
You will see that there are entries which are being generated with a front end form (https://wordpress-490485-2085818.cloudwaysapps.com/available-taxi-form-submission/) which is also from jet engine (Jet Engine Form Builder).
Plus on AVAILABLE page I have also added filters like:
1. Taxi from:
2. Taxi to:
3. Car model:
4th is just the remove option that appears when I choose any filter (good stuff)
Now features which I can’t get from CrocoBlock is that I for the sake of getting minimum requirement need:
A date filter (more important) I need a date filter, not date range, like if you see the AVAILABLE page (https://wordpress-490485-2085818.cloudwaysapps.com/page-1-available/) I have Date: in all entries. I want to filter these listing with DATE FIELD option.
And
A Multi Select Dropdown in form, example expedia.com, not as fancy as their but like when I search a city like Jaipur, then I just need to type J or JAI and I get related options in form.
Its a important feature but I can live without it.
Now date field option is available with JET Smart filter but its not working properly and the team at CrocoBlocks have accepted it as a Bug.
So, I can get what I want with ACF?
Regards
Jatin Chhabra
Nice one!
Re: creating/deleting posts as needed – each of my repeater rows require a file upload so I might use that attachment ID as a ‘key’ for each row to then create/update/delete posts as needed!

Please answer the question that I asked.
I am attempting to help you figure out why it’s not showing. Your code does not indicate a reason. Debugging is required.

The simple answer is no.
WordPress only returns a post as a result once in search results. What you want to do would require WP to return the same post multiple times in the results.
In order to have them appear as different results they would need to be different posts instead of different rows of a repeater. If this is the results that you need then you should be using different posts instead of a repeater.
Key/Value store indeed has it’s own surprises. as I bump into php redis extension, the redis servers do provides store key-value and Redis shines when you want to use data structures such as lists, sets, strings, hashes, sorted sets with range queries, geospatial indexes, hyperloglogs, bitmaps, and streams
I would suggest building your sidebar as widget. WP recently integrated Gutenberg into the widgets aswel.
To register a sidebar:
if (function_exists('register_sidebar'))
{
// Define Sidebar Widget Area
register_sidebar(array(
'name' => __('Sidebar'),
'description' => __('Sidebar voor de vervolgpagina\'s'),
'id' => 'sidebar',
'before_widget' => '<div id="%1$s" class="%2$s">',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
}
Then implement this code in your sidebar area:
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar')) ?>
answered here https://support.advancedcustomfields.com/forums/topic/post-status-as-protected-with-acf-field/ slope game
Thanks for this – much appreciated!
Hi there John!
The loop is pretty much standard:
if ( $posts ) {
foreach ( $posts as $post ) :
get_template_part( 'includes/loop-job', get_post_type());
endforeach;
wp_reset_postdata();
}
Right? So at least I’m not missing something totally obvious. 😀 Thanks for that already! 🙂 I kinda hoped that there would be some kind of thing that everybody knew about except for me, but my code NOT being the obvious problem at least tells me I’m not a total idiot. 😉
It might of course be some other plugin causing this problem.
Now I could start and hunt down the culprit, but I just thought of a workaround that should do the trick as well, what do you think:
The Problem is during sorting in a query and only hits the Address-Repeater section. I could of course hook into saving an article and THERE turn the cities into a string and save THAT in a normal (non-repeater)-field… Those aren’t affected by the glitch or whatever it is…

Old question, but I’ve never had an issue saving a script that in a text area field. I use them to allow this all the time. When I have had an issue with this it is usually to do another plugin, for example Wordfence, blocking it.

If your field is on an options page and not the current post then you need to supply the correct post ID
[acf field="contact" post_id="options"]
https://www.advancedcustomfields.com/resources/shortcode/

ACF stores a list of user IDs as a serialized array.
The meta key of the field will be "{$group_field_name}_{$sub_field_name}"
your meta query might look something like this
'meta_query' => array(
array(
'key' => "{$group_field_name}_{$sub_field_name}",
'value => '"'.$user_id.'"',
'compare' => 'LIKE'
}
)

I don’t have an exact answer for you, only a possible path to solving it.
You will want to start here https://www.advancedcustomfields.com/resources/javascript-api/#filters-select2_ajax_data
and here https://www.advancedcustomfields.com/resources/acf-fields-taxonomy-query/
The first thing you’ll need to to is to alter the ajax data being sent for each field to include the values selected in the other field.
Then in the query filters for each field you need to get the values sent in the ajax query and use that value in the ‘exclude’ argument for get_terms().
Sorry that I cannot provide any code for you.

See the section on Dynamic $_GET parameters

Is this a repeat of your other question: https://support.advancedcustomfields.com/forums/topic/images-problems-on-edit-post-form/

$vid_args = array(
'posts_per_page' => -1,
'post_type' => 'resource',
'orderby' => 'title',
'order' => 'ASC',
'meta_key' => 'sal_resource_type',
'meta_value' => '"Video"',
'meta_compare' => 'LIKE'
);

to get unformatted value requires 3 arguments
$images = get_field('slides', false, false);

How are you looping over the posts returned by the query?
To be honest, I don’t see any reason looking at the code you provided that the values would be shown other that then posts do not have any values set.
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.