Acf order by meta key Can you assist me? Feb 28, 2025 · With this update, you can set the query to order first by the popularity meta field in descending order and then by date added in ascending order, ensuring that the most popular and newest items appear at the top. User metadata is a powerful feature that can be used to store custom information about users, such as their preferences, settings, or additional profile information. Jun 11, 2021 · I need to get the meta value of the ACF field. In this case the query orders by display_name, set as meta_key in line 20. Optimize database performance by adding proper indexes and using efficient query operators. Nov 13, 2017 · I have custom post type event which has custom field event_date. Aug 7, 2025 · Hi there, As the meta field key is decided by the custom field plugin (ACF), you should check their documentation area. Meta Box Sanitization Callback A PHP function name to be called tor sanitizing taxonomy data saved from a meta box. As it is being saved as a serialized array, I am trying to […] Nov 4, 2022 · 1. Description WP_Meta_Query is a class defined in wp-includes/meta. Is there another method or plugin that can include information captured in a custom product field during order export? May 23, 2016 · If I remove orderby and meta_key, my query works just fine. e. Steps Create and apply loop grid template Begin by designing your loop grid template within your Elementor page Apr 15, 2015 · Hello, I'm a ACF Pro user and i'm having problem with field group order. Take a look at WP_Query Custom Fields section, particularly the part about “meta_query” which you need to use to filter or order by multiple fields. I have tried this on my local setup to confirm this. There is also an ID number assigned to each child to help with keeping track. m. Step 1 Assign whatever value you want to your meta key, let's call it my_meta_key, for each post to generate whatever order you want. but the ordering after 10 is wrong. Custom fields are metadata 6 days ago · Use dynamic data to render all sorts of data from your WordPress database with Bricks. Adjust the Query: Within the query loop block settings, adjust the query to sort by the custom field (event date) in ascending order. and set my several posts as like 99 98 97 to show first in homepage. Jan 24, 2017 · The meta query is used to set the release category and the meta_key value changed to the key you'd like to order by. Note that you need to select (when using ACF fields) the meta key that DOES NOT have a name preceded with an underscore. The field name mentioned in meta_key is correct. I created a query for the custom post type of "departments" the query gets me every department with ACF field "type_of_cetifecate" = "bach" and with a certain category id, until this point everything is working fine, but when I try to sort the query by certain numeric acf fields the query doesn't work, my code so far: Feb 13, 2025 · Use ACF for better data organization to streamline metadata storage and retrieval. To get it, when you are on the Edit Field Groups page, simply go to Screen Options on top right corner and then enable Field Key. Mar 10, 2025 · Speed up your workflow and unlock features to better develop websites using ACF Blocks and Options Pages, with the Flexible Content, Repeater, Clone, Gallery Fields & More. I have added a metabox numeric field to a custom post type, simply want to add a numerical ordering to each post … 1,2,3 in the query loop, order: by : meta numeric value order meta key: string that I added to the meta query below Added a meta query gave the meta key a string Apr 18, 2023 · The meta_key option specifies the name of the custom field to sort by. To do this, we create a custom filter to replace the standard ‘=’ with ‘LIKE’. Custom Order Clauses with Meta Queries: Bricks now supports more complex ordering directly aligned with meta query conditions. //DATE type custom field Dec 23, 2022 · Summary – Now you know how to use wp query order by Wp-query – a built-in WordPress functionality – provides an option to sort elements using post_date. Jan 18, 2023 · Hey guys Is there a way to use the meta key with a post loop, to query say an ACF field to see if it’s 1 or 0 (true false) and only show the posts that way? I know you can make a custom wp query but wondered if that was needed as it’s relatively simple. Would then the meta_key_num only be grabbing the “posts with a value” posts to then sort – with the rest left to the default WP archive sorting of reverse date? Oct 3, 2018 · I needed to sort the custom posts in a REST API response by a meta value, this is how I did it. post_id = p. php that generates the necessary SQL for meta-related queries. Mar 4, 2022 · Amazing, thank you! This worked but for me, I was scratching my head a bit until I realised that grouped fields will need the parent meta key along with the field meta key. meta_key LIKE and the wildcards are not works. Implement caching strategies Feb 17, 2019 · To set a Custom Field as the sort order, select Post Meta (which is what a Custom Field is) and then select the Meta Key. Add query options meta_key – {YOUR ACF FIELD} orderby – meta_value_num order – ASC (This will sort by oldest first) My ACF field was called date in my example below 2. But I'd like that event to remain visible until the event end date has passed. Thanks your help! But what if you want to customize the order of your grid items based on an ACF checkbox field? This tutorial will show you how to prioritize items marked as “sold” to appear at the end of your Elementor Loop Grid, keeping your content fresh and relevant. The ‘value’ is numerical so that I can sort them using meta_value_num. This field type would save the meta acf field value in the database as 0 or 1 integer. The return format of the date field is Ymd. I Mar 4, 2025 · Hi there, I found this documentation for sorting query loops based on an ACF date field. The plugin allows you to manage custom fields efficiently, reducing the complexity of meta_query operations and making data relationships easier to maintain and query. But I do see how this could cause performance issues and will look at the bidirectional relationship field. Here's the documentation for WP_Query. The field group key must begin with group_. Apr 21, 2023 · A PHP function name to be called to handle the content of a meta box on your taxonomy. Aug 22, 2025 · Automatically retrieve choices set in ACF or Meta Box fields and display them as options in Filter – Checkbox, Radio, and Select elements. The date format for this field is set to Ymd. For example: Group field name/key: event_dates Field date name/key: event_date_1 So you meta key is actually: event_dates_event_date_1 Hope that helps someone. Aug 11, 2021 · Hi at all, I’ve got a problem with sorting events with ACF date fieldand I hope someone can help me. I'm not able to properly get this working. g. Note that PHP & Json export files will get updated accordingly. WP version: 4. Then any post that meets the criteria but Dec 11, 2020 · However, how can I implement such conditional usage? It feels a bit complicated to use has_rows () for my case. Secondly, the 'compare' parameter in the 'event_product' array should be 'EXISTS' or 'NOT EXISTS' if you want to check if the key is present or not. Aug 13, 2013 · Elliot August 13, 2013 at 2:31 pm Hi @refreshingdesign ACF is an interface for creating field types. I've also set order to meta_value_num which is important when dealing with numerical values. Apr 24, 2017 · In the ACF config, it's set to text and the values of this text can be Bronze, Silver, Gold etc. This is quite useful when showcasing upcoming events, ensuring that only current events are displayed in ascending order, starting with those closest to the current date. My query is just like yours with the only difference being my meta_value is set to 1. meta_key = 'campaign_end_date' and p. Feb 21, 2023 · How can I locate the meta key for a custom product field? I can see the ID: 12345. Now in my archives page I want to sort the courses based on the start_date which has a meta_key of sub_seminars_0_start_date. Oct 22, 2024 · Discover the ACF Taxonomy field: Connect, display, and manage taxonomy terms with flexible options and bidirectional updates. Apr 8, 2025 · Meta Query help needed (ACF) Resolved pradg (@pradg) 7 months, 1 week ago Hi, I am building a database of devices. Here on the single product page edit screen, after installing my snippet, you can now see how “_backorders” is now visible for example. com/roelvandepaarWith thanks & praise to God, and Nov 27, 2021 · WordPress meta query mechanism is a powerful tool to query and order the posts in WordPress. Step 3 Set orderby in your query to meta_value_num. May 9, 2021 · I have an ACF field called sale_or_charter with three radio options – for sale, charter or new build. This might require a bit of database investigation to ensure you find the correct meta key. function get_acf_key($field_name) { I have a custom ACF field set on all posts, called event_date, I would like to grab all posts within a given category, but have posts that have event_date defined put first in DESC order of event_d May 19, 2023 · We can easily make custom sorting inside a Query string, with orderby=meta_value&meta_key=some_key Then we can for example use ACF fields to instruct the looper about the exact ordering. I'm trying to get posts in order of event_date Here is the code to pull the posts in Jun 4, 2016 · Ordering posts by number field treated like a string. Show: only Nov 28, 2023 · If you need filter your advanced query by ACF field, you need to use the field as a meta_key and then order by meta_value. UPDATE I've now changed the level field to a number and switch it round 1 = Bronze, 2 = Silver etc. May 30, 2025 · Key points: Meta queries let you filter WordPress posts by custom field data, but can severely impact performance if not optimized. Example Using the query above, it sorts the different posts by ACF date. Jun 26, 2015 · In order to do this you need to get the terms, then loop through the terms, get your custom field and add it to each term object and then build a PHP function to order them. Meta Key: Replace priority with the name of your ACF field (e. You can set it up in Advanced query builder in Oxygen builder like this: Mar 10, 2025 · Therefore, we need to use a LIKE clause in our SQL query to allow for a WILDCARD in the meta_key search. In order to set up the relationship I used ACF repeater fields with the following data: Sep 3, 2022 · 0 You say your meta ACF field is a true or false field type. The custom field "deadline" is returning the date with the format "d. Jan 2, 2017 · I'm requesting posts with the WP REST API and need to sort them according to an ACF field. What is your ACF field type set as? Have you tried turning on the debug. The events are set up with a repeater for dates and times. May 21, 2023 · I’m wondering if it’s something to do with the way the meta-query is structured especially because it is separating out “posts with a value” and “posts without a value”. Does this help? Jan 17, 2024 · WP_Query sort by multiple custom fields Bas van der Togt (@basvandertogt) 1 year, 10 months ago I have a custom post type with two acf fields, ‘type’ (options are: news and event) and &… Feb 5, 2016 · I wonder if anyone can help me with this little complex query with ACF. Works great. Oct 30, 2020 · I’m hoping someone can help. Could you please help me with this? Feb 10, 2015 · So your wp_postmeta. 0 and greatly improved the possibility to query posts by custom fields. Jun 6, 2018 · Hello, I have a custom post type with a user relationship field. meta-query terms meta-value term-meta Improve this question edited Jul 2, 2016 at 15:54 birgire Wordpress: Order posts by meta key ( Using ACF )Helpful? Please support me on Patreon: https://www. Add query ID to loop grid Finally, return to your loop grid widget and apply the query ID “ dd_event_date ” under Content > Query > Query ID PHP Code Snippet Order by Date Replace the start_date with your own ACPT or ACF meta field key. But there are numerous spelling mistakes in your code. For example: Featured image, post title, post date, author name, categories, tags, site title, all of your custom fields, etc. The meta key to retrieve. But then I need to sort them by city, and I'm lost at that point. If your posts are activities and you want to sort them based on the nearest one, you can't. I have a Custom Post Type with ACF fields “Manufacturer” and “Ye… Jun 6, 2018 · Hello, I have a custom post type with a user relationship field. Jul 12, 2017 · The strange thing is that the meta_query is working, but the ordering by date isn’t. Feb 7, 2019 · In order to query by the ACF Date Picker field and display the posts in ascending order, set ‘orderby’ to ‘meta_value’, the ‘order’ to ‘ASC’ and the meta_key to the name of the ACF Date Picker field. Simplify meta_query and tax_query by limiting conditions and avoiding unnecessary nested queries. Then look at the orderby section and the code example titled ‘orderby’ with multiple ‘meta_key’s I've been trying to order these exhibitions based on the end_date custom field created with Advanced Custom Fields. Second, check, how I use the NOT NULL and the string comparison. Mar 11, 2021 · Since order_date_end in not references in the query anywhere WP can’t use it. Same as @GwendleWeb, we are building websites for musicians, bands and venues who have the need to display custom May 12, 2024 · You must be logged in to reply to this topic. I searched through everything a ton but can’t seem to figure it out. Individual posts within the CPT receives input such as an image, child age, sponsorship availability, date of birth, etc. Jan 22, 2025 · Unlock WordPress post meta secrets! Learn to display all keys and values with our step-by-step guide. By default, returns data for all keys. Welcome! We can't help with code support for third-party plugins (ACF) as it is off-topic here. May 16, 2023 · This Pro tutorial shows how to configure ACF and Meta Box to query posts in Bricks by custom field (s) of the type Date/Date Time Picker when using ACF or Date/Datetime when using Meta Box. Step 2 You set meta_key in your query to my_meta_key. 'meta_key' => 'featured', 'meta_value' => '1', Edit: What is Custom Field Group Key It is possible to set a custom field group key for any field group. Jul 11, 2013 · This will order the query results by the meta_value of ‘presenter’. Such as your blog post template, and custom post […] Nov 8, 2022 · The meta key targetted here in this thread is a custom meta field created by the Customer. We can even use a custom field with a custom format (a date defined as string value Ymd) and order elements according to our needs. Query clauses 100% do not work with a nested query that has multiple meta keys associated with it. data so I can get_post_meta/update_post_meta instead of get_field/update_field? How to filter the posts of a post type related to another post type based on the value of a True / False type ACF field. It will get all of the posts that have a value set and order it by the membership type descending which is what you want. Feb 17, 2018 · John Huebner February 20, 2018 at 6:59 am It is pretty much impossible to do what you want to do. Thank you. ACF will use the field’s name as the meta_key and the value entered as the meta_value. Currently, I am using [Products & Order Export for WooCommerce Pro] plugin to export order information, and without the meta key, I cannot capture necessary information. In this article, we Nov 4, 2022 · 1. post_status = 'publish' order by pm. You can set it up in Advanced query builder in Oxygen builder like this… Apr 30, 2025 · Introduction In this tutorial, you’ll learn how to order your Elementor loop grid based on an ACF meta field. . Here's my current […] May 13, 2023 · Hi, I’ve read the other posts about ordering a the display order of a query loop, but nothing is working for me. Meta key: date_of_event (Note: the value for this field is stored in Ymd format) Meta value: (empty) Would you be so kind as to tell me what I’m doing wrong? Thank you for your help! Jan 17, 2014 · ACF creates field groups within posts as a custom post type of ACF, but all the data about the fields themselves is held within the post_meta table. ACF Extended allows developers to add custom metas values in the Field Group settings directly from the Field Group administration. Choose the right storage method: use taxonomies for filterable data, custom tables for complex structures, and post meta only when necessary. I have a custom number field (by ACF). meta_value asc and based on that, the expected order of these posts should be: Jun 19, 2019 · I need to show a list of custom-posts sorted by a custom-field "deadline". ID where pm. Nov 28, 2023 · If you need filter your advanced query by ACF field, you need to use the field as a meta_key and then order by meta_value. I am attempting to query all posts with that post type for which the user field contains the ID of the current user. 'event_product' is the actual meta key you want to order by. I want to be able to alpha-sort by one of the custom fields in the posts (MY_NAME_FIELD in the below code) while ALSO filtering posts that have a specific flag on a different custom field (SHOW_POST in the below code). This works in my case, but I wanted to know if there’s a way to make this work on nested Post Meta Queries as… Apr 4, 2021 · tarheeldev April 4, 2021 at 3:24 am Thanks for the suggestion, I got it working with the multiple arrays. Apr 25, 2025 · Hello, the Query Loop, with GenerateBlock Pro, can be sorted by a numeric value. This tells WordPress to query for posts that have that key. Sep 4, 2022 · I retrieve the raw data with this query select p. How can i create a query where i can […] Apr 14, 2020 · If you manage custom fields in WordPress using Advanced Custom Fields, and you want to use WPGraphQL to get a list of posts filtering by the ACF field value, you’ll need to implement a few things in your themes functions. is there a way to get ‘meta key’ with javascript api from field. I feel like it’s impossible to sort with an ACF field because I encounter the same issue with all these fields. I’ve got a group that has a start and end date. This is because I want to sort a… Feb 23, 2018 · I've got a wp_query that queries posts under a custom post type Events, and uses meta_query to filter posts by values of a repeater field, to filter events that are in the future or past. Being able to easily sort a loop grid by ACFs - i. Aug 17, 2018 · Essentially I want that filter to work any time the Artworks field ‘artist_name’ is being used as a meta_key to sort so that ‘meta_value’ can be replaced with ‘artist_last_name’ + ‘artist_first_name’ instead of the post ID. Check out this article to find out how to use it. As it is being saved as a serialized array, I am trying to […] Nov 4, 2023 · WordPress, the world’s most popular content management system, offers a robust user management system, which allows you to store and retrieve additional information about your users through user metadata. the date picker field, combined with the options of filtering past/upcoming dates, and filtering by year would make the new loop grid incredibly powerful and finally move on from the last remnants of WP's "blogging" legacy. Steps Create your loop grid template Open your Elementor page editor. 2. And the orderby parameter specifies that the results should order depending on the numeric value of the custom field. It seems like a posts_join and then posts_orderby filter would work but I can’t get this join to work: Introduction ACF together with WP custom types and ACF-to-Rest can provide the basis for a great headless CMS however due to the way ACF stores the data in the wp_postmeta and due to the API design of ACF (and ACF-to-Rest) this approach tends to be quite expensive. ACF Compatibility: Support fields like Relationship, multiple values fields, and Post Object fields. I actually use the following code but the order of the posts is wrong and has no pattern i can decipher. Order: Set to ASC for ascending order (soonest to latest) or DESC for descending order. Jan 28, 2019 · During search in 2 meta key( say acf hr_archive_title and acf hr_archive_question ), I want to list down post in following order. Perfect for developers seeking advanced customization. Feb 22, 2025 · The Bricks Builder query loop has a parameter to filter your query by adding a meta query. So if you want order listings posts by premium meta field in DESC order then it would be something like Oct 18, 2022 · I'm trying to order content by the dick picker provided by ACF. Jan 18, 2023 · Query clauses have a few issues that are not documented and you only find them by finding theme. Step-by-step guide for both code and ACF implementations, plus Gutenberg compatibility. Perfect for advanced WordPress users. I know how to do it with a normal WP_Qu Jun 4, 2013 · What should I add to order the results by two other keys ('produkt_kategoria' and 'produkt_cena')? There's nothing about it in WP Codex, but this: Aug 31, 2015 · Did you try 'orderby' => 'meta_value_num', instead of simply 'meta_value' Check out the ACF Documentation too - it's pretty thorough. You’ll most likely use dynamic data when creating templates in Bricks. Descending DESC order means all the posts where premium is set to true 1 will appear first. I’d like to order by the start date. meta_value from wp_posts p inner join wp_postmeta pm on pm. But the orderby is not working. It was introduced in Version 3. php. 5. Format the Date Display: To ensure the event date is user-friendly, use the formatting option available in Bricks Builder. Honestly, I don’t remember if they work at all with nested meta queries. I get the posts sorted if […] Dec 23, 2024 · Each training has training times. In line 5, it sets an AND relationship between the two meta queries. Any help would be greatly appreciated. You do not need to cast your field to string, since it's already a LONGTEXT field. Summary: Register a new “where” argument to the WPGraphQL Posts connection Filter the Posts connection resolver to account for this new argument Register the new But to get the checkbox option names, we need to get the field key which is not same as our meta_key 'skateboard_performance'. This example also shows how to order by a meta_value. Mar 19, 2017 · I have a course page i which I use a repeater field called "sub_seminars" with date pickers "start_date" & "End_Date" inside to display course start and end date. Jan 23, 2024 · Whether on grids or carousels with the “custom field” order and { {coefficient}}, it doesn’t function. Unless you’re writing a custom SQL May 30, 2025 · Key points: Meta queries let you filter WordPress posts by custom field data, but can severely impact performance if not optimized. But as soon as they’re added in. It doesn’t pull anything up. But I need get the meta key of a sub-field from the group. Use the meta key corresponding to your event date field in ACF. Nov 16, 2016 · sorry for being late Im gonna try thanks for your reply "meta_key" => "price", // The name of the meta field key we're trying to sort by "orderby" => "meta_value_num", // Telling the query we're trying to sort the results by a meta field, and that the meta field contains a number. Please take a look, thanks May 10, 2019 · Sorry if this is redundant. ACF stores field key separately. Jul 12, 2015 · But shouldn’t that mean that the field key hasn’t been saved to the meta table either at that point? To my knowledge the field key is only saved in one location (for wp_postmeta) and that is as the value of _field_name. Apr 29, 2022 · The WordPress meta query can be incredible useful at building custom functionality on your WordPress site using PHP. The set up: I have a CPT (sponsor) where I have assigned an ACF group (not an acf field group – just a group). I have a Custom Post Type with ACF fields “Manufacturer” and “Ye… Jun 3, 2017 · But I also need the posts to be organized by month, in a descending order (so October 2004 appears before January 2004 etc). Apr 21, 2020 · WordPress will not show custom fields which have meta_key starting with an “_” (underscore) in the custom fields list on the post edit screen. log and looking for any errors there? I do this myself extremely often with a ACF true/false field to mark posts/things as "featured" or what not to pull in on other pages. Right now, once the event […] May 9, 2023 · ACF expects each meta key to have exactly one entry in the database. I know you can loop normally in Bricks Loop builder but not used it much to check for a ticked ACF box at the same time to check the posts By default Elementor allows you to order your posts by title, date, menu order or totally randomly. My ACF select field for ‘month’ uses the format 1 : January / 2 : February / 3 : March, etc. For example, subfields of an ACF group field will have a different meta key. 5 in the WP_Comment_Query class. first preference is post with searched text found in hr_archive_ti Oct 16, 2015 · CyberstylingsLLC October 16, 2015 at 4:09 pm I guess basically what I need is the answer to this,… this is the meta key info I see when I create the fields via ACF _pick_order field_561f52378230b pick_order P20-1061 _product_cost field_561f521f8230a product_cost 6. As it’s a custom field created through ACF, there’s no list for that. Am I doing something wrong? I also tried changing the order_by value to meta_value instead of meta_value_num, but that didn’t make a difference. 14 Thanks in advance. Jun 22, 2023 · -1 you're trying to order by 'event_passport' which is a meta query, not a meta key. wp_Query needs to be WP_Query, you have two meta_key values, and type_of_cetifecate is spelled wrong (but that may be how it's defined in your code, double check that). I’ve created a numeric custom field and would like to sort posts by this ACF field. Aug 28, 2017 · Continue to help good content that is interesting, well-researched, and useful, rise to the top! To gain full voting privileges, Oct 1, 2020 · meta_key = baseprice_0_rate meta_value = 100 - 1000 // different values because of the prices meta_key = promotional_bike meta_value = 1 // because true or false in acf Jun 16, 2023 · Oddly, when I start typing ‘page_order’ under meta key, this meta key’s name doesn’t pop up in the suggestions, making me think that the plugin can’t see it even though I have ACF set to show this field group in the Rest API (maybe this points to the issue). I have the following so far which should display: Pages, News Articles, About Articles and Involved Articles. It's possible to order by "meta_value" as well, however this treats it alphabetically instead. Try this directly in MySql and tell me the results in the comment. 69 What is the actual meta key . In this post, we will discuss what a meta query is in WordPress and how you can use the Bricks Builder query loop meta query to supercharge your query loops! What Is A Meta Query In WordPress A meta query in WordPress is a way to filter posts based on their associated metadata. Sep 18, 2013 · The topic ‘ORDER BY on SELECT not working’ is closed to new replies. Oct 15, 2024 · More about ACF Fields What is the Meta Key for an ACF field? Show me how to create a conditional using the ACF Meta Key Options for showing ACF Fields in Admin Columns How do I set up ACF Relational fields? How do I display ACF Relationships in templates? Common starter questions with ACF How do I display data from a grouped field in ACF? Dec 4, 2019 · I'm trying to figure out if it's possible to write a custom query to sort a post module by multiple ACF fields. Using a custom field for a date is more flexible than WordPress publish_date and allows to have items Aug 21, 2013 · Basically, I’m using WP_Query to iterate through acf posts (Custom fields) & get the metadata, then filter the metadata starting with ‘field_’ to fill an array using the field name as key and the field key as value, to be used like this: Feb 22, 2025 · When you create a taxonomy with ACF, it becomes a physical taxonomy, and you use that taxonomy from now on, you don’t use a meta key for that taxonomy to apply the values you need to it. May 31, 2020 · Order Posts by Custom Fields When Meta Key Already In Use Jan 24, 2017 · The meta query is used to set the release category and the meta_key value changed to the key you'd like to order by. NOTE: Any post not having a value in this custom field will be excluded from the results. It simply doesn't work, as you can see in the following image. Y". It's value represents a date (numeric, jQuery date format yymmdd). The issue i am having is that some events run over a couple of days. , event_date). post_title, pm. patreon. As for doing this for orderby is even more impossible simply because you’d be trying to order the posts by multiple different meta_key rows. The get_field_object only returns partial information if queried by name - to return the full object you need to use the field key. 8 ACF PRO 5. Jan 22, 2022 · I found the function acf_get_fields() and acf_get_field(), but when using field types like group, flexibel_content or repeater the names in the returned arrays are not the full names that are stored in the meta database tables. Matching one repeater row to another in a the where of an SQL query is not possible in any way. In order to change the key, you’ll have to display the “Slug” metabox. Apr 23, 2017 · I try to have a pretty simple query with the new syntax, query posts by a certain post_type (services) that contains a specified meta_key (order_in_archive)- this is going well as expected. Filter – Datepicker: Access ACF and Meta Box date and time formats without requiring manual configuration. I need the most recent dates first. Each field created will appear on a post and allows you to save a value to the wp_postmeta table. The trainer for the training can differ depending on the timeslot. That was previously hidden! Jul 22, 2023 · Is it possible to order by a ACF custom date field using AQL? I’ve entered the following parameters in the AQL block with no success: Order by: Meta Value (also tried Meta Value Num) Ascending order is true. ACF needs the Google Maps API in the backend to geolocate the address entered for each post. Each custom post type will have one of these values – I would like to then display related posts that have the same value for the sale_or_charter field as the current page. ACF field called 'submitdate' (format => Date Time picker : Y-m-d H:i:s) already has data '2021-06-11 17:23:36' I tried the following code, but it Feb 20, 2015 · Filter query by custom field and sort orderby another custom field Aug 20, 2021 · ‘post_type’ => ‘post’, ‘posts_per_page’ => 12, ‘meta_key’ => ‘post_views_count’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’ )); But strange, the mysql querry works just fine: SELECT * FROM wp_postmeta WHERE meta_key = ‘post_views_count’ ORDER BY meta_value DESC Any help is apperciated, thanks Mar 14, 2023 · We can update user profile fields with ease, we just need the meta key of the field and then insert a value. For each training time a trainer and a “halle” is associated. I have a CPT for PEOPLE, and I have ACF fields for first_name and last_name. Mar 8, 2024 · Customize the PHP Code: CSS Class: Replace order-by-priority with the class name you added earlier (order-by-date). Query clauses do not work well with nested meta queries. Mar 26, 2022 · The meta_key is typically just the ACF field’s name, but it might be stored under a different name, depending on your schema. order by date field Dates in order of soonest (past/present) to farthest out (ASC ordering). In the WP core, it’s used in the WP_Query and WP_User_Query classes, and since Version 3. The user field allows for multiple values. The query used to work, but according to […] Jan 2, 2023 · For example, in vanilla ACF there's no easy way to get the field object from the field name, despite what the documentation says. any combination of what I see above does not seem to work Thanks 4 days ago · Add your Google API key to Advanced Custom fields Besides adding the Google Maps API key to the FacetWP settings, also make sure to pass a valid Google Maps API key into ACF. It sounds like you’re trying to also query posts with a specific ‘presenter’ value. The group’s na Oct 22, 2024 · Learn how to sort WordPress posts by custom field (post meta) to customize your content display beyond default sorting options. The following example demonstrates how to use multiple meta_query parameters to filter the query results by two custom field values. Another cause of saving an reverting to some other value can be the existence of multiple fields with the same name (meta_key). I need to order my posts by calling the featured properties with a radio button selection of "yes : Yes", then display the other posts under "properties" by their 'property_status' of rent, rent and new, sale, then sale and new. Appearance Menus Support Enabled by default, controls if items can be added to menus in the ‘Appearance’ > ‘Menus’ screen. any combination of what I see above does not seem to work Thanks Oct 16, 2015 · CyberstylingsLLC October 16, 2015 at 4:09 pm I guess basically what I need is the answer to this,… this is the meta key info I see when I create the fields via ACF _pick_order field_561f52378230b pick_order P20-1061 _product_cost field_561f521f8230a product_cost 6. Saving but reverting to a previous value is a symptom of having multiple entries in the database for the user with the same meta key. To do this you would need to: 1) Do your first query to get Jan 30, 2020 · 0 I have a WP_Query call set to load a custom post type that I've created. Apr 7, 2014 · I've looked at the docs and I see how to sort based on an ACF field, but here's my dilemma: I'm pulling custom post types based on their state, and showing them on a page. meta_key = won't replaced by wp_postmeta. This guide explains how to sort your list of posts by values from Advanced Custom Fields (ACF) or Meta Box fields in Breakdance. Mar 6, 2025 · Learn how to build secure, custom meta boxes in WordPress with data validation. Type: Ensure the type is set to DATE. gkzxgng bsivm swqsx lyzareb vgym clfde eilrj paqcecx kkhrvx aaaqjdi uzf xenh xoppb iksu nhidt